Click to See Complete Forum and Search --> : Order by latest date/time


scottyrob
10-15-2006, 11:11 AM
Hi,
I have a php script that shows all the news on my website. In the DB i have a field called CurrentDateTime which displays 2006-10-15 00:00:00. How can i order the SQL to display only 5 items of news, and those 5 being the latest pieces?

I currently have..

$result = @mysql_query('SELECT * FROM tblNews ORDER BY ID');

LiLcRaZyFuZzY
10-15-2006, 11:28 AM
$result = @mysql_query('SELECT * FROM tblNews ORDER BY `CurrentDateTime` DESC LIMIT 5');