Caldera_Mike
asked on
Displaying number of products in a category - MySQL Query
Hi, I have a table in MySQL with properties in it with fields such as house.roadname & house.propertytype.
When a user searches my database for a road name, i'd like the query to group by house.propertytype and also state how many results per propertytype in brackets (so I assume it passes this value to a php variable?) Lets say the user searches for Windsor Road, I'd like the results to look like this:
Windsor Road (Total 67 Properties)
Detached House (18)
Semi-detached House (38)
Detached Bungalow (9)
Semi-detached Bungalow (2)
Can someone enlighten me on the query as I'm no expert but the theory seems so simple!
When a user searches my database for a road name, i'd like the query to group by house.propertytype and also state how many results per propertytype in brackets (so I assume it passes this value to a php variable?) Lets say the user searches for Windsor Road, I'd like the results to look like this:
Windsor Road (Total 67 Properties)
Detached House (18)
Semi-detached House (38)
Detached Bungalow (9)
Semi-detached Bungalow (2)
Can someone enlighten me on the query as I'm no expert but the theory seems so simple!
ASKER
Hi, y but how do i pass the count result per propertytype to php to display it? Thats the bit i'm stuck on.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
cool, going to try this out now....
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Open in new window