php mysql query: multiple drop down options

weirdoftw

New Member
I have a search box that the user can select a $location a $type and a $rating.\[code\]$result = mysql_query("SELECT * FROM Places WHERE Location = '$location' and Type ='$type' and Rating = '$rating'")or die(mysql_error()); \[/code\]This works fine if the user selects and option from all 3 drop down boxes- however how do I make the msql query check the database if the user only selects a location for example.I have a "Any" option on all 3 drop downs incase they wish to leave a dropdown blank.Thanks
 
Back
Top