Dear Sunil,

First of all make an array of you are reading from file.
Like that:
<?
$sel = "Selcect fild1,fild2 from myfile";
$res= mysql_query($sel);
while ($row=mysql_fetch_row($res))
{
    $my_array[$row[0]] = $row[1];
}

// tem:
asort($my_array);
for(reset($my_array); $ind=key($my_array); next($my_array))
{
print ("$ind : $my_array[$ind] <br>");
}
?>



Sunil Jagarlamudi wrote:

> I am trying to read a file which has two columns with names and numbers and
> I am trying to sort them numerically, with the
> highest at the top. Is there anyway you can do that in php ?
>
> Thank You
>
> Sunil
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to