My SQL statement isn't sorting right. I want to sort by date.
The table called 'news' has five columns:
id (autoincrement int)
published (date)
url (varchar)
title (varchar)
source (varchar)
The dates in the published column look like this: 2003-05-27
This the SQL statement (in PHP):
$query = "SELECT DATE_FORMAT(pub lished,'%M %e, %Y') AS whatnot, url,
title, source FROM news ORDER BY whatnot";
The query result does not sort by the date. Can anyone tell me what's
wrong?
Thanks for your help.
The table called 'news' has five columns:
id (autoincrement int)
published (date)
url (varchar)
title (varchar)
source (varchar)
The dates in the published column look like this: 2003-05-27
This the SQL statement (in PHP):
$query = "SELECT DATE_FORMAT(pub lished,'%M %e, %Y') AS whatnot, url,
title, source FROM news ORDER BY whatnot";
The query result does not sort by the date. Can anyone tell me what's
wrong?
Thanks for your help.
Comment