Re: still problem with getting HIGHest and LOWest VALUES
| From: | Hidulf | Date: | Sun, 30 Sep 2001 14:58:48 +0000 |
| Subject: | Re: still problem with getting HIGHest and LOWest VALUES | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69362@lists.php.net to get a copy of this message | ||
try this
$x = mysql_query("SELECT * FROM $dealer_tabela ORDER BY cena");
$row = mysql_fetch_array($x);
natsort($row);
print 'id - price<br />\n';
while (list ($key, $val) = each ($row)) {
print $key .' - ' .$val .'<br />\n';
}
--
Hidulf
http://www.hidulf.com
"Teqila Man" <teqilaman@poczta.wp.pl> wrote in message
news:001801c149bb$63026d60$0100007f@tm...
> The table has values :
>
> id - price
> 1 - 150000
> 2 - 24000
> 3 - 65000
> 4 - 200000
>
>
> When i want to sort it
>
> $x = mysql_query("SELECT * FROM $dealer_tabela ORDER BY cena");
> while ($row = mysql_fetch_array($x))
> {
> $id=$row["id"];
> $price=$row["price"];
> print("$price<br>\n");
> }
>
> It returns me values :
> 150000
> 200000
> 24000
> 65000
>
> What is false! It sorts this by getting first values ? How to fix it ?
>
> Thanks for your help
> tm.
>