ShanesProjects Posted October 10, 2006 Share Posted October 10, 2006 I got 4 users and there ranks are 1, 2, 3, and 14. Why dose this show it User1-User14-User2-User3 instead of User1-User2-User3-User14?[code]$sql3="SELECT * FROM guild_members WHERE Disabled='0' ORDER BY Rank DESC";[/code] Quote Link to comment Share on other sites More sharing options...
GremlinP1R Posted October 10, 2006 Share Posted October 10, 2006 Just add some zero's in the front. It will not display on your page but will put it in order.The system looks first for all the one's and then go for all the two's ect.like11111111112222222222if you put the zeros in the front it will pick it up as00010002001100220111022211112222 Quote Link to comment Share on other sites More sharing options...
obsidian Posted October 10, 2006 Share Posted October 10, 2006 the rank is being sorted as a string rather than an integer. what is your datatype of your "Rank" column? Quote Link to comment Share on other sites More sharing options...
ShanesProjects Posted October 10, 2006 Author Share Posted October 10, 2006 Its varchar(250). Quote Link to comment Share on other sites More sharing options...
obsidian Posted October 10, 2006 Share Posted October 10, 2006 [quote author=ShanesProjects link=topic=111126.msg450149#msg450149 date=1160511454]Its varchar(250).[/quote]since it is varchar, you'll need to do some sort of padding or adjustment as gremlin suggested. do your values contain the digits only, or is the actual string "user1" your value? Quote Link to comment Share on other sites More sharing options...
ShanesProjects Posted October 10, 2006 Author Share Posted October 10, 2006 What can I change it to for it to work? Quote Link to comment Share on other sites More sharing options...
ShanesProjects Posted October 10, 2006 Author Share Posted October 10, 2006 Fixed it! Changed it to int. Thanks anyways. 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.