In message <[EMAIL PROTECTED]>, Bob <[EMAIL PROTECTED]> writes >Hi, >I want to read the latest message left and I used this, but if the db was >sorted, it would fail. > >SELECT * FROM forum ORDER BY logged DESC LIMIT 1 > >logged is a TIMESTAMP(14), so I really should be looking for the highest >timestamp (I think?). > >How to I select logged = highest (or most recent) ? >Thanks, Bob.
Depends on the DB, but if you were using MySQL, then the table would never be "sorted". It would always be in the same order, with indexes to find things faster. -- Pete Clark http://www.hotcosta.com http://www.spanishholidaybookings.com Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
