Unholy Prayer Posted November 26, 2006 Share Posted November 26, 2006 This is probably a noob question, but how do I change the order that table fields are displayed in?This is my query:[code]$result = mysql_query("select * from news order by id limit 5");[/code]Instead of displaying the news from the first news posted to the most recent news posted, I want the most recent news posted displayed first. Quote Link to comment Share on other sites More sharing options...
fert Posted November 26, 2006 Share Posted November 26, 2006 DESC Quote Link to comment Share on other sites More sharing options...
Unholy Prayer Posted November 26, 2006 Author Share Posted November 26, 2006 So just add "DESC" to the end of the query? Quote Link to comment Share on other sites More sharing options...
fert Posted November 26, 2006 Share Posted November 26, 2006 [code]SELECT * FROM `news` ORDER BY `id` DESC LIMIT 5[/code] Quote Link to comment Share on other sites More sharing options...
Unholy Prayer Posted November 26, 2006 Author Share Posted November 26, 2006 Ahhh, thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.