Page 1 of 1

MySQL - Reversed ORDER BY

Posted: Sun May 08, 2005 1:15 am
by James M.
Alright, I have a table that stores news and I need to display the news backwards so that the latest news is at the top, and oldest at the bottom. Can anyone help? I've searched the forum, but couldn't find anything. TIA.

Posted: Sun May 08, 2005 1:22 am
by Vicious
this should help either put DESC OR ASC, i can remember which one is which, but make sure its at the end of the statement. unless its followed by a LIMIT. ex.
$db = mysql_query("SELECT * FROM `table` ORDER BY `row` DESC LIMIT 6");

Below is the line that should be used.
ORDER BY `row` DESC

Posted: Sun May 08, 2005 1:24 am
by James M.
lol, I feel stupid now, was looking at the mysql documents and the DESC and ASC didn't register that they could be ascend and descend. Thanks.