thanks it works great but I need the form to be in html form, then have it submitted to the search.php code.
how do you set up like that???
for example my index.html with the form...
<form method="post" action="search.php">
<br>
Price
<select name="price">
<option value="any" selected>any</option>
<option value="0">$100,000 or less</option>
<option value="1">$100,000 to $150,000</option>
<option value="2">$150,000 to $200,000</option>
<option value="3">$200,000 to $250,000</option>
<option value="4">$250,000 to $300,000</option>
</select>
<br>
<input type="Submit" name="Submit" value="Submit">
</form>
then of course it is submitted to the search.php
$sql = "SELECT * FROM homes WHERE models LIKE '%$search%'";
if ($_POST['bed'] != "any") {
$sql .= " AND bed = '".$bed."'";
}
if ($_POST['bath'] != "any") {
$sql .= " AND bath = '".$bath."'";
}
if ($_POST['garage'] != "any") {
$sql .= " AND garage = '".$garage."'";
}
if ($_POST['price'] != "any") {
$sql .= " AND price= '".$price."'";
}
$result = @($sql)
or die("<p>Couldn't execute query: <strong>".mysql_error()."</strong></p>");
while($r=mysql_fetch_array($result))
{
$models=$r["models"];
$bed=$r["bed"];
$bath=$r["bath"];
$garage=$r["garage"];
$sqft=$r["sqft"];
$id=$r["id"];
echo "<u>models:</u>$models<br> <u>bed:</u> $bed<br> <u>bath:</u> $bath<br> <u>garage:</u> $garage<br> <u>sqft:</u> $sqft<br><br>";
}
?>
sorry, I didn't fully explain myself.