I want to pull several rows out of a database ordered first by city name, then by price (it's for real-estate listings). I know how to order by one field, like this:
Code:
$query = "SELECT * FROM listings WHERE 1 ORDER BY price DESC";
But how would I order it first by the city, then by the prices (from high to low) within that city so that they come out in an order like this:
city1, high-price
city1, med-price
city1, low-price
city2, high-price
city2, low-price
city3, high-price
...and so on.
Thanks for any tips.