close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Trying to build a recordset for photos and use a form input for the photos upload and a text field to add a photo category for all the photos uploaded under that category

Thread began 8/20/2021 4:05 pm by JBWebWorks | Last modified 8/23/2021 9:19 am by Ray Borduin | 32 views | 4 replies |

JBWebWorks

Trying to build a recordset for photos and use a form input for the photos upload and a text field to add a photo category for all the photos uploaded under that category

Have a table with the columns being photos_ID, photos_image, photos_caption, photos_description, photos_era and photos_ok.
Have a form that a user inputs his photo or photos and a description of the event where the photos were taken, i.e. Cookout, Birthday Party, Trip to the beach etc. In the recordset i use where photos_ok ='yes' so the photos don't show until approved.
On the page to display the photos, i want the photos_description to be a heading and all the photos with that photos_description to show under the heading as a repeat region.
Not sure how to write the recordset in order to accomplish this?

Sign in to reply to this post

Ray BorduinWebAssist

I don't really understand where you are getting stuck.

I think you could use two nested repeat regions and move the reocrdset that returns the photos inside the recordset that shows the heading and filter it.

Your first recordset would be SELECT DISTINCT photos_description

Then apply a repeat region to display the descriptions. Add a photos recordset inside that repeat region and filter the photos returned by the description field to show all the images with that description. You can apply the repeat region for the photos under the description header.

Sign in to reply to this post
Did this help? Tips are appreciated...

JBWebWorks

Thanks Ray.
I am stuck on filtering the second recordset. Not sure how to write the SELECT photos when photos_description is the same? I know it should be simple.

the first recordset

<?php
$rs_photos1 = new WA_MySQLi_RS("rs_photos1",$connstake,0);
$rs_photos1->setQuery("SELECT DISTINCT photos.photos_description FROM photos ");
$rs_photos1->execute();
?>
Sign in to reply to this post

Ray BorduinWebAssist

The second recordset (copy and paste into the repeat region of the first)

php:
<?php

$rs_photos2 
= new WA_MySQLi_RS("rs_photos2",$connstake,0);
$rs_photos2>setQuery("SELECT * FROM photos WHERE photos_description = ?");
$rs_photos2->bindParam("s""".($rs_photos1->getColumnVal("photos_description"))  ."""-1"); //currentCategory
$rs_photos2->execute();
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

JBWebWorks

Thanks Ray.
I had the second recordset written correctly; i didn't have it positioned inside the repeat region for the first recordset.

Tip coming your way....

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...