Seriously new to PHP/mySQL and need just a little help.
I've got a real estate property database that I want to search based on beds/baths, price, and type (apartment, condo, or house). I've got the search and output working great for everything but the type. My search form uses checkboxes to indicate which type of property to search for. Here it is:
<form name="GWCsearch" method=GET action=searchform.php>
<select name=beds>
<option value="EFF">EFF</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5+">5+</option>
</select>
<input type=text name=price size=8 maxlength=9>
<input type=submit name="submit" value="SEARCH">
<input type = checkbox name=chkType[] value="APT">Apartment<br>
<input type = checkbox name=chkType[] value="CONDO">Condo<br>
<input type = checkbox name=chkType[] value="HOUSE">House/Duplex
</form>
Then the code for the search based on # of bedrooms and price is:
mysql_select_db (gowestca_properties);
$result = mysql_query("SELECT *
FROM properties
WHERE prop_beds = '$beds'
AND prop_price <= '$price'
") //search for matches
or die(mysql_error());
I've tried several things and I can't seem to figure out how to only select the records whos type the user checks in the checkbox. Obviously there needs to be a "AND prop_type = ???????" in the mySQL query, but I'm not sure what goes in place of the ??????. I know this is probably very easy, but I'd appreciate the help.
Thanks