Results 1 to 2 of 2
Jun 2, 2009, 11:09 #1
- Join Date
- Dec 2004
- 0 Post(s)
- 0 Thread(s)
Query about how to do a simple(ish) Select
I have photo details stored in table j_p1
If I am displaying photoID 732, for example, I would like to use SQL to output 5 photos near the current photo - e.g, I'd like to display photos
>> 732 (Current photo)
So it finds photos two either side of the current photo.
My babyish SQL can do this:
SELECT photoID, photoFileName, photoFileType FROM j_p1 WHERE photoID < 732 ORDER BY photoID DESC LIMIT 5
Any advice much appreciated.
Jun 2, 2009, 22:00 #2