Tiltan Posted April 5, 2009 Share Posted April 5, 2009 Im trying to order a list of numbers. But its not properly ordering, the list ends upp like this: 1 10 100 1000 11 12 2 I want the list to go in order 1 2 10 11 12 100 1000 Code.. Well in short: "SELECT * FROM _TABLE_ WHERE something='something' ORDER BY id" (ASC or DESC dosent matter) If you want the full code i can give it. I just cant see how it would change the "order by" since it dosent change the numbers anywere. Quote Link to comment https://forums.phpfreaks.com/topic/152609-solved-order-by-not-properly-ordered/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 5, 2009 Share Posted April 5, 2009 It's probably a wrong datatype. Use integer instead of string/varchar. Quote Link to comment https://forums.phpfreaks.com/topic/152609-solved-order-by-not-properly-ordered/#findComment-801487 Share on other sites More sharing options...
Tiltan Posted April 5, 2009 Author Share Posted April 5, 2009 Changed it to int instead of varchar. Working properly now, Thanks Just dont have a clue of what they all mean and what they are for :-\ Quote Link to comment https://forums.phpfreaks.com/topic/152609-solved-order-by-not-properly-ordered/#findComment-801498 Share on other sites More sharing options...
PFMaBiSmAd Posted April 5, 2009 Share Posted April 5, 2009 http://dev.mysql.com/doc/refman/5.0/en/data-types.html Quote Link to comment https://forums.phpfreaks.com/topic/152609-solved-order-by-not-properly-ordered/#findComment-801505 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.