ronnie88 Posted June 14, 2010 Share Posted June 14, 2010 Hello I am having a problem I have this code below that outputs all the data in the users table, but when I use DESC in rankid column it doesn't get the "full number" just the first number of that number. Here is what I am talking about http://crytell.com/roster.php that 35 should be at the top but I'm thinking its only going by first number how do I get it to go by all the number... thanks <html> <head><title>Clan Roster</title></head> <body> <?php include 'db.php'; $result = mysql_query( "SELECT * FROM users ORDER by rankid DESC" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); print "There are $num_rows members in VerX<P>"; print "<table width=650 border=1>\n"; while ($get_info = mysql_fetch_row($result)){ print "<tr>\n"; foreach ($get_info as $field) print "\t<td><font face=arial size=1/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; ?> </body> </html> <p style=" position: absolute; bottom: 0; left: 0; width: 100%; text-align: right;"><a href="http://www.Crytell.com">Roster Script Made By Vital</a></p> Link to comment https://forums.phpfreaks.com/topic/204709-little-help-with-order-by-and-desc/ Share on other sites More sharing options...
ronnie88 Posted June 14, 2010 Author Share Posted June 14, 2010 nvm I got it mysql row had to be set as integer Link to comment https://forums.phpfreaks.com/topic/204709-little-help-with-order-by-and-desc/#findComment-1071714 Share on other sites More sharing options...
JackAtack Posted June 14, 2010 Share Posted June 14, 2010 have you tried the natsort() function http://php.net/manual/en/function.natsort.php Link to comment https://forums.phpfreaks.com/topic/204709-little-help-with-order-by-and-desc/#findComment-1071715 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.