时间:2021-07-01 10:21:17 帮助过:11人阅读
至少要这样 $query = "select * from s where pro='$pro'";
贴出你的代码看看啦
至少要这样 $query = "select * from s where pro='$pro'"; 结果是一样的无法匹配到 单独显示$pro都有值
贴出你的代码看看啦 if (!empty($_POST["sname"])) { $sname = $_POST["sname"]; } else {$sname="空";} if (!empty($_POST["sid"])) { $sid=$_POST["sid"]; } else {$sid="空";} $pro = $_POST["pro"]; $grade=$_POST["grade"]; $class=$_POST["class"]; ?> if ($grade =="全部" && $class =="全部" && $pro=="全部" && $sname=="空" && $sid=="空" ) { $query = "select * from s order by sid desc"; } else if ($grade =="全部" && $class =="全部" && $pro=="全部" && $sname!="空" && $sid=="空" ) { $query = "select * from s where sname=$sname order by sid desc"; } else if ($grade =="全部" && $class =="全部" && $pro=="全部" && $sname=="空" && $sid!="空" ) { $query = "select * from s where sid=$sid order by sid desc"; } else if ($grade =="全部" && $class =="全部" && $pro=="全部" && $sname!="空" && $sid!="空" ) { $query = "select * from s where sid=$sid and sname=$sname order by sid desc"; } else if ($grade =="全部" && $class =="全部" && $pro!="全部" && $sname=="空" && $sid=="空" ) { $query = "select * from s where pro=$pro order by sid desc"; } $result = $db->query($query); if ($result >0) { while ($row = $result->fetch_assoc()) { ?>
至少要这样 $query = "select * from s where pro='$pro'"; 可以了 多谢
< 上一篇
怎么将php的cookie转化成对象或数组?
下一篇 >
js根据php生成的js变量a=1表示有某种动作的权限,这样安全吗
记住我的登录 忘记密码?
登录
我已阅读用户协议及版权声明
注册