Page 1 of 1

Reversing Order

Posted: Mon Feb 13, 2006 9:19 pm
by psurrena
Here's a hopefully basic question:

Right now this piece of code displays articles from the lowest ID the highest, in other words, the oldest is first, the newest is last. How do I reverse the order?

Code: Select all

$query  = "SELECT id, title, abstract FROM article ORDER BY id";
Thank you,
Peter

Posted: Mon Feb 13, 2006 9:19 pm
by John Cartwright

Code: Select all

$query  = "SELECT id, title, abstract FROM article ORDER BY id ASC";

Code: Select all

$query  = "SELECT id, title, abstract FROM article ORDER BY id DESC";

Posted: Mon Feb 13, 2006 9:22 pm
by psurrena
Incredibly quick! Thanks!