Lucky2710 Posted July 22, 2010 Share Posted July 22, 2010 I'm trying to pull out peoples scores from a mySQL table. the field name is "nc_points" but i've got to keep each score associated with its id which is in the field "id". Then once they are pulled out i want to display them in a leader board type setup (probably in a table) so they are going to have to be some how sorted in order from high to low or low to high. What i need help with is the sorting from low to high! I aint got a clue!!!! Im looking someone to point me in the right direction! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/208575-sorting-mysql-data-in-php-in-order-from-highest-to-lowest/ Share on other sites More sharing options...
Lucky2710 Posted July 22, 2010 Author Share Posted July 22, 2010 by the way the data in mySQl is all numbers! (for both "nc_points" and "id") Quote Link to comment https://forums.phpfreaks.com/topic/208575-sorting-mysql-data-in-php-in-order-from-highest-to-lowest/#findComment-1089749 Share on other sites More sharing options...
PFMaBiSmAd Posted July 22, 2010 Share Posted July 22, 2010 You generally use an ORDER BY column_name ASC/DESC term in your query so that the data is retrieved in the order that you want it. Quote Link to comment https://forums.phpfreaks.com/topic/208575-sorting-mysql-data-in-php-in-order-from-highest-to-lowest/#findComment-1089751 Share on other sites More sharing options...
Lucky2710 Posted July 22, 2010 Author Share Posted July 22, 2010 Thanks That was too easy!!! Quote Link to comment https://forums.phpfreaks.com/topic/208575-sorting-mysql-data-in-php-in-order-from-highest-to-lowest/#findComment-1089773 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.