类似于这种多条件查询在写sql时
$sql = "select * from building where 1=1 ";
if(!empty($area) && isset($_GET['subs'])){
$sql = $sql." and city ='" . $area . "'";
}
if(!empty($price) && isset($_GET['subs']) ){
$sql = $sql . " and price " . $price;
}
if(!empty($house) && isset($_GET['subs']) ){
$sql = $sql . " and bd_type = '". $house."'";
}
//这个是文本框搜索的值判断
if(!empty($gsmc) && isset($_GET['subs']) ){
$sql = $sql . " and name like '%$_GET[gsmc]%' or city like '%$_GET[gsmc]%' or bd_type='$gsmc'";
}