phpretard Posted February 5, 2008 Share Posted February 5, 2008 The code below puts the number 125 before the number 25 when sorted asc. I am pretty sure it's because of the 1 in 125. I would like to arrange asc with the 25 first because these aren't the only numbers involved. Has anyone run into this before? $result = mysql_query("SELECT * FROM rentals ORDER by $var"); Any help ?? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 5, 2008 Share Posted February 5, 2008 What datatype is that is the column with 125 & 25 in it? I'm guessing it's VARCHAR. Should it be INT? Quote Link to comment Share on other sites More sharing options...
phpretard Posted February 5, 2008 Author Share Posted February 5, 2008 It will be all numbers. Quote Link to comment Share on other sites More sharing options...
phpretard Posted February 5, 2008 Author Share Posted February 5, 2008 I changed it and it worked. Thank you! Quote Link to comment 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.