SELECT * FROM images WHERE id > ? ORDER BY id LIMIT 1 [download]
In reply to Re^2: Calculating previous/next from database by ikegami in thread Calculating previous/next from database by Anonymous Monk