I'm trying to pull records out of my database based on the oldest date.
The MySQl table looks like this:
status, date, last, url
1, 2010-12-30 17:59:54, 2011-01-03 06:26:04, site1.com
1, 2010-12-28 12:16:10, 2011-01-03, 06:25:24, site2.com
The date and last rows are datetime.
Here are two types of queries I tried:
mysql_query("SELECT * FROM links WHERE status=1 ORDER BY last DESC LIMIT 0,25");
mysql_query("SELECT * FROM links WHERE status=1 ORDER BY DATE(last) DESC LIMIT 0,25");
The query works for the most part but always leaves some of the oldest records out...
Any ideas?
Thank you
DATEonlast.