brem13 Posted June 4, 2009 Share Posted June 4, 2009 hey, im trying to sort data from a table in desc order, but the results will show like this 8 7 5 2 11 1 1 1 here is the code i use $result = mysql_db_query('rant_brem', "select * from `all` WHERE approved = 'Yes' AND yes > 0 ORDER BY yes DESC LIMIT 250") or die (mysql_error()); any reason why? Link to comment https://forums.phpfreaks.com/topic/160859-solved-not-in-right-order/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 4, 2009 Share Posted June 4, 2009 Because your column type is not INT. It is some char/text and that is how strings are sorted. Columns holding numbers should be a numeric type not a char/text type. Link to comment https://forums.phpfreaks.com/topic/160859-solved-not-in-right-order/#findComment-848942 Share on other sites More sharing options...
brem13 Posted June 4, 2009 Author Share Posted June 4, 2009 thanks you! Link to comment https://forums.phpfreaks.com/topic/160859-solved-not-in-right-order/#findComment-848949 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.