<?php
$sql = "select * from student where 1";
if($name) {
$sql .= " and name = '$name'"}
if($sex) {
$sql .= " and sex = '$sex'"}
if($deep) {
$sql .= " and deep = '$deep'"}
?>
php多条件查询
阅读:3866 输入:2014-09-12 01:01:11
<?php
$sql = "select * from student where 1";
if($name) {
$sql .= " and name = '$name'"}
if($sex) {
$sql .= " and sex = '$sex'"}
if($deep) {
$sql .= " and deep = '$deep'"}
?>