Jump to content


This topic is now archived and is closed to further replies.


gallery help

Recommended Posts

I have a build-your-own-website website and one of the add-ons is a gallery.

In my gallery table I have the following fields:
id, owner, timestamp, filename, thumbname, title, description, category, ordering

Currently it shows the thumbs in a list and the user clicks each thumb and it just opens the fullsize image.

I wanna make a page that you can click a thumb, view the image but also click NEXT or PREVIOUS.

The only way I know of this is if I use a WHERE id=(id+1) type thing.
but these arent always going to be consecitive for that user.

How can I make it so it views the NEXT one thats viewed under ORDERING (ordering is sometimes blank too)

Main SQL for the initial listing:

$query="SELECT * FROM gallery_images WHERE category = '$cat' AND owner = '$usern' ORDER BY ordering DESC LIMIT $offset, $limit";

Share this post

Link to post
Share on other sites
Does anyone know how to do this? I just wanna make it so it fetches the next ID in the database.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.