Jump to content


Photo

gallery help


  • Please log in to reply
2 replies to this topic

#1 treez

treez
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 25 March 2006 - 01:42 AM

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";

#2 treez

treez
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 28 April 2006 - 10:14 PM

Does anyone know how to do this? I just wanna make it so it fetches the next ID in the database.

#3 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 28 April 2006 - 10:45 PM

what does the query on the fullsize page look like?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users