vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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/...rt_mother.html http://what-is-what.com/what_is/sql_injection.html |