The stupid question is the question not asked | |
PerlMonks |
Re: Building an index for next/last in a photo album.by waswas-fng (Curate) |
on Jul 26, 2004 at 20:15 UTC ( [id://377558]=note: print w/replies, xml ) | Need Help?? |
If the next and previous are just -- and ++ the id on the current image, you can do (in psudo sql) select images from the database where the image ID is greater than or equal to ($id - 1) and image ID is less than or equal to ($id +1) ordered by id . then you just need to special case the times where the database returns < 3 results (top and bottom of the stack).
-Waswas
In Section
Seekers of Perl Wisdom
|
|