Jump to content

[SOLVED] MySQL Number Sorting


maxudaskin

Recommended Posts

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>';
}
?>

Link to comment
https://forums.phpfreaks.com/topic/69125-solved-mysql-number-sorting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.