in reply to
Re: Building an index for next/last in a photo album.
in thread Building an index for next/last in a photo album.
I had considered that, but the problem is that the img_id's are sequential in the database -- not the album. In other words, if I wanted img_id #43, I could not just say "give me img_id #42, #43 and #44" - because #42 and #44 could possibly belong to another album_id for the same user - or another album_id for a completely different user.
Here is an example of the table:
img_id | album_id | uid | name | ext
-------+----------+-----+--------------+------
38 | 14 | 89 | mypetrat | jpg
39 | 14 | 89 | mypetlemur | jpg
40 | 2 | 12 | vacation_01 | jpg
41 | 14 | 89 | mypetvulture | jpg
42 | 2 | 12 | vacation_02 | jpg
43 | 2 | 12 | vacation_03 | jpg
44 | 14 | 89 | mypetcow | jpg