把他的sql查询的写死的变量, 你用搜索穿过的替换掉就可以了啊,
sql的 where根据筛选条件改变而改变,举个例子:
$filter['brand'] = isset($_REQUEST['brand']) ? trim($_REQUEST['brand']) : '';//品牌
$filter['price'] = isset($_REQUEST['price']) ? trim($_REQUEST['price']) : '';//价格
$filter['attribute'] = isset($_REQUEST['attribute']) ? trim($_REQUEST['attribute']) : '';//属性
$where = " WHERE 1";
if($filter['brand'] != ''){
$where .= " AND brand=" . addslashes($filter['brand']);
}
if($filter['price'] != ''){
$where .= " AND price=" . addslashes($filter['price']);
}
if($filter['attribute'] != ''){
$where .= " AND attribute=" . addslashes($filter['attribute']);
}
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号