maxudaskin Posted September 13, 2007 Share Posted September 13, 2007 http://www.virtualzoom.net/index_2.php#toppilots Why is it sorting it like this: 9.5 9.2 8.7 67.8 4.2 11.67 It is only sorting the first digit... how can I rectify it? <?php mysql_select_db(,); $toppilots_query = mysql_query("SELECT * FROM users ORDER BY hours DESC LIMIT 3"); while($toppilots = mysql_fetch_array($toppilots_query)) { echo '<table width="242" border="0" cellspacing="3" cellpadding="0">'; echo '<tr>'; echo '<td width="12" align="center" valign="middle" bgcolor="#EFF4FB"><span class="cell_stats_table">OOM' . $toppilots['pid'] . '</span></td>'; echo '<td width="200" align="center" valign="middle" bgcolor="#EFF4FB"><span class="cell_stats_table">' . $toppilots['fname'] . ' ' . $toppilots['lname'] . '</span></td>'; echo '<td width="30" align="center" valign="middle" bgcolor="#EFF4FB"><span class="cell_stats_table">' . $toppilots['hours'] . ' hrs</span></td>'; echo '</tr>'; echo '</table>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/69125-solved-mysql-number-sorting/ Share on other sites More sharing options...
trq Posted September 13, 2007 Share Posted September 13, 2007 What field type is hours? Quote Link to comment https://forums.phpfreaks.com/topic/69125-solved-mysql-number-sorting/#findComment-347446 Share on other sites More sharing options...
maxudaskin Posted September 13, 2007 Author Share Posted September 13, 2007 varchar(10) not that there will be a ten digit number in it any time soon Quote Link to comment https://forums.phpfreaks.com/topic/69125-solved-mysql-number-sorting/#findComment-347457 Share on other sites More sharing options...
maxudaskin Posted September 13, 2007 Author Share Posted September 13, 2007 Bump as this is pretty important to me... Quote Link to comment https://forums.phpfreaks.com/topic/69125-solved-mysql-number-sorting/#findComment-347474 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.