troubleshooting Question

Show all bedrooms or cities in property site query

Avatar of BrighteyesDesign
BrighteyesDesignFlag for Afghanistan asked on
5 Comments2 Solutions390 ViewsLast Modified:
On a property site the user can search selecting various criteria: city, bedrooms, pricemin and pricemax.

All works fine if you select a particular city or bedroom but want I want is the ability to search all bedrooms or/and all cities. Any ideas how i'd do this?

The price part is fine, for pricemin for the all label I use the value '0' and for pricemax '5000000000000' so all results from any price show.

This is the code currently...

$country_code = $_GET["intsearch"];
$bedrooms = $_GET["bedrooms"];
$min = $_GET["min"];
$max = $_GET["max"];
$cityCode = $_GET["city"];

SELECT propertyID, customer, letby, additionalimage1, additionalimage2, additionalimage3, additionalimage4, additionalimage5, additionalimage6, additionalimage7, additionalimage8, additionalimage9, additionalimage10, address, bathrooms, bedrooms, brochure, details, floorPlan1, floorPlan2, floorPlan3, floorplan4, fullPostCode, furnished, groundRent, HIPDocument, leaseholdYearsRemaining, mainimage, name, prices, pricePrefix, propertyType, receptionRooms, regionCode, saleOrRent, fullPath, planbutton, google, prices2, pricePrefix2, `currency`, epcbutton, bullets, currency2, country_code, streetview, cityCode FROM properties WHERE country_code = %s   AND cityCode = '$cityCode' AND bedrooms='$bedrooms' AND prices BETWEEN '$min' AND '$max' ORDER BY prices ASC
Theo Kouwenhoven
Application Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros