This isn't really a PHP problem, but I would imagine somebody can help me here. I have a webpage which has a column for price. The user can click on the column heading and have the output sort on that column. But, it is not sorting the output correctly. Here is the PHP code:
} elseif ($sort == "price") {
if(($stores != "") or ($type9 != "") or ($make9 != "")) {
$result .= " WHERE id is not null";
if($stores != "") {
$result .= " AND store = '{$stores}'";
}
if($type9 != "") {
$result .= " AND category = '{$type9}'";
}
if($make9 != "") {
$result .= " AND make = '{$make9}'";
}
}
$result .= " order by price";
The column in the database is a VARCHAR(25) and this is with MySQL. The output looks like the following:
1050.00
110.00
119.99
125.00
1250.00
129.99
1299.99
149.99
How can I have the output sort numerically?
Thanks for any help you can offer.
Jeff