Question
Price not decending or ascending properly
I am trying to process information and want to order it by
price. I have a form to choose to show the price ascending or
decending.
I'm getting values like this:
£79,950.00
£52,500.00
£164,950.00
£14,500.00
The prices are stored in my database like this: 52500.00
My SQL statement is:
$query_results = "SELECT *
FROM property
WHERE B_R = 'BUY'
AND Accepted = 'Yes'
AND (City = '$_REQUEST
I'm getting values like this:
£79,950.00
£52,500.00
£164,950.00
£14,500.00
The prices are stored in my database like this: 52500.00
My SQL statement is:
$query_results = "SELECT *
FROM property
WHERE B_R = 'BUY'
AND Accepted = 'Yes'
AND (City = '$_REQUEST
quote:
' Or Postcode = '%$_REQUESTquote:
' Or Area = '$_REQUESTquote:
')
AND NoBeds $NoBeds
AND Cost BETWEEN $_REQUEST[minPrice] AND $_REQUEST[maxPrice]
ORDER BY Cost $_REQUEST[sort]";
I tried ORDER BY Cost + 0 $_REQUEST[sort]";
That only works for one Ascending, how can I make sure they all work correctly?
My database table: Cost varchar(11)
