$sql = "SELECT *
FROM Listings
WHERE status!='sold'
AND suburb IN (".$sql_2.")
AND price BETWEEN ".$pricefrom." AND ".$priceto."
AND beds BETWEEN ".$bedfrom." AND ".$bedto."
AND land_area BETWEEN ".$landfrom." AND ".$landto."
AND baths<= ".$bath."
AND lugarage<= ".$lug.""
if ($pool != ""){
echo "AND pool = ".$pool;
}
"ORDER BY '".$order."'";
echo $sql;
its this part.
if ($pool != ""){
echo "AND pool = ".$pool;
}
see i have a a select box that the user selects N/A , Yes, No
Yes and No have values in my database
Yes = 1
No = 0
but N/A dosent its value in the form is.
<option value="" selected>N/A</option>
<option value="0">No</option>
<option value="1">Yes</option>
</select>
so what im trying to do above is if the value of pool is = to "" then dont write that line else write it.
cheers aron.