Selecting mutiple records, but only displaying one in SQL?

Associate
Joined
13 Nov 2003
Posts
1,567
Location
Manchester
Hi All

Working on a photo gallery for Mysql.

On the gallery thumbnails page I want to be able to click on a thumb and itloads a page that shows that photo, I can do that with 'get' from the url, so thats not an issue.

However I also want to add a previous and next button to the page. So once the user has clicked on the photo it will load it in the photo viewer page, but also the user will be able to click next, and goto the next photo in the gallery, or previous and do the opposite.

The galleries are based on the date the photo was taken.

At the moment when the user clicks on the thubnail it loads the page and the sql query gets the image URL for the corresponding image, however it does not have the ability to recall all of the photos, just the one that matches the id passed by the get

Sure this doesnt make sense lol
Aaron
 
what language ?

either way you need to get all records and use some kind of counter to reference the specific image

cant think of another way im afraid

ive done this in asp if you need some code
 
Last edited:
i guess it depends on the way you have your database set up, but if each set of photos was its own group something like

Group A > 1
Group A > 2
Group A > 3
Group A > 4

Group B > 1
Group B > 2
Group B > 3
Group B > 4

You could just use the links ID ++ for the next link and -- for the previous - basically adding 1 or subbing 1 from the current link id for the forward or backward?
 
Back
Top Bottom