Phaelon Posted May 13, 2014 Share Posted May 13, 2014 (edited) Hi all,I have a MySQL table with the field 'number'.When I SELECT * from that field, I get a return for the rows of 'number' in the order 1, 2, 3, 4, etc... SELECT * FROM products; Is there a way where I can get a return in the reverse order, so highest to lowest (4, 3, 2, 1, etc...)? Edited May 13, 2014 by Phaelon Quote Link to comment https://forums.phpfreaks.com/topic/288456-listing-mysql-table-in-reverse/ Share on other sites More sharing options...
Solution Barand Posted May 13, 2014 Solution Share Posted May 13, 2014 SELECT .... ORDER BY whatever DESC Quote Link to comment https://forums.phpfreaks.com/topic/288456-listing-mysql-table-in-reverse/#findComment-1479319 Share on other sites More sharing options...
Phaelon Posted May 13, 2014 Author Share Posted May 13, 2014 Thanks, but it didn't work. SELECT * FROM products DESC; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/288456-listing-mysql-table-in-reverse/#findComment-1479321 Share on other sites More sharing options...
Barand Posted May 13, 2014 Share Posted May 13, 2014 Then I suggest you re-read my post Quote Link to comment https://forums.phpfreaks.com/topic/288456-listing-mysql-table-in-reverse/#findComment-1479322 Share on other sites More sharing options...
Phaelon Posted May 13, 2014 Author Share Posted May 13, 2014 Wow! Yeah how did that happen!! OK I tried it, it works. You are truly awesome! Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/288456-listing-mysql-table-in-reverse/#findComment-1479327 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.