Unholy Prayer Posted March 31, 2007 Share Posted March 31, 2007 How do I order my sql results in descending order? This is my query: mysql_query("SELECT * FROM members order by uid limit 1 descending"); Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 31, 2007 Share Posted March 31, 2007 That example would only return ONE result ... but typically replacing descending in your example query with DESC will provide a descending order. Or do you really just want to know the maximum value of uid? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted March 31, 2007 Share Posted March 31, 2007 mysql_query("SELECT * FROM members ORDER BY uid DESC LIMIT 1"); Quote Link to comment Share on other sites More sharing options...
Unholy Prayer Posted March 31, 2007 Author Share Posted March 31, 2007 I have more than one result. I used that script and got the row with the uid of 1. I want it to display the newest record... in simpler terms I just want it to display the newest registered user so it should order it in descending order. But pocubueno's worked. 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.