mac007 Posted May 23, 2008 Share Posted May 23, 2008 Hi, I am trying to set up a php/mysql select statement to select records from this type of url string: www.sampelsite.com/workCategories.php?region=Florida&city=Hollywood&type=condo&button=Search%21# In turn the mysql select statatement I have is: SELECT * FROM item WHERE category = colname AND city = cityName OR type = typeProp ORDER BY price This is not filtering the data just right, cause I need to bring back, let's say all items under "Florida" if somebody just chooses region (and leaves "city" or "type" unselected); in other words, the filter should scale down as one selecs deeper, so if only Florida, then bring up just Florida, and if one chooses "Florida" and "Miami" for city it shouth gather as such, and so on with "type" ... what's happening now is, ifI leave city emtpy it also brings all entries since it's reading the url as "city=" and then gets bunch of records... Appreciate any help... Quote Link to comment Share on other sites More sharing options...
fenway Posted May 29, 2008 Share Posted May 29, 2008 You will have to build up your where clause in PHP, only adding the columns where data has been entered Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.