Forum Moderators: open
I wound up creating a function that'll return the first, last, previous, or next depending on a variable passed.
There is already a 'sort_order' field so that the user can sort each album however they want. So, next is 'SELECT id FROM table WHERE sort_order>$current_sort_order AND album_id=$current_album_id ORDER BY sort_order ASC LIMIT 1;'. Previous is similar. Last and First just get the id of the min(sort_order) and max(sort_order).
Maybe not the cleanest, but it works.