dink87522 Posted August 31, 2009 Share Posted August 31, 2009 I am using $query = "SELECT * FROM Highscores ORDER BY score DESC"; to select data from a table called highscores and a field called scores. I wish to sort the data in descending order (i.e. highest value first). It sort of works, ie.: it does: 9 8 7 6 5 4 3 2 13 12 11 1 etc, how do I make 11, 12, 13 show at the top? Quote Link to comment https://forums.phpfreaks.com/topic/172510-sorting-mysql-table-ascending/ Share on other sites More sharing options...
dink87522 Posted August 31, 2009 Author Share Posted August 31, 2009 Title should read descending, not ascending sorry. Quote Link to comment https://forums.phpfreaks.com/topic/172510-sorting-mysql-table-ascending/#findComment-909432 Share on other sites More sharing options...
.josh Posted August 31, 2009 Share Posted August 31, 2009 change your column data type to something numerical instead of string based. Quote Link to comment https://forums.phpfreaks.com/topic/172510-sorting-mysql-table-ascending/#findComment-909434 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.