I have a table of photos, that I display in chronological order on an index page: http://dotancohen.com/eng/pictures/index.php
I'd like to have next (and previous) buttons on the page that displays individual photos, but the photos ID numbers are not chronological. So I need to find a way to select the photo that is next chronologically, with that information being available in a datetime column. I was thinking of using this query: SELECT * FROM photos WHERE datetime > '$datetimeOfCurrentPicture' ORDER BY datetime asc LIMIT 1,1 Is there maybe a better way to do this? Thanks in advance. Dotan Cohen http://lyricslist.com/lyrics/lyrics/44/402/pink_floyd/atom_heart_mother.html http://what-is-what.com/what_is/sql_injection.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]