PHP and MySQL search with extra counts along the way
- by Barry Connolly
I am building a PHP and MySQL search as so
SELECT * FROM Properties WHERE Locaion = 'Liverpool'
I want to count how many of each property type there are and display them at the side of the page to use as filters (like Rightmove.co.uk).
This is what I am have come up with but can't get it to work
SELECT *,
count(PropertyType = 'house') AS HouesTotal,
count(PropertyType = 'Apartment') AS ApartmentTotal
FROM Properties WHERE Location = 'Liverpool'
Can anyone help?