if($generator == "" || $_SESSION['rank'] == 5){
$generatorquery = "SELECT * FROM `generators`";
}else{
$generatorquery = "SELECT * FROM `generators` WHERE `id` = ".$generator;
}
如何修复第一行代码?
答案 0 :(得分:0)
如果我说得对,如果你想检查变量“generator”是否为空(它有一个值)那么这对你有用:
if(empty($generator) || $_SESSION['rank'] == 5)