对于多条件查询,使用sql语句拼接比较方便。
如:$sql= "SELECT * FROM aaa where id is not null";
if($sum != ""){$sql.=" and sum='$sum";}
if($price != ""){$sql.=" and price='$price";}
if($date != ""){$sql.=" and date='$date";}
$sql.=" order by id desc"