$ status返回0,但循环的行为与其“1”相同。这里有趣的是我的错误信息是“MySQL DB正在使用(状态0)”。即使它是真的,我的“if”语句也会返回false,为什么?
换句话说:即使它是真的,我的if语句也会失败。
哪里错了?
include 'status_check.php'; //it takes $check from MySQL DB
if($status = "0") { //if status is 0 go on
include 'status_1.php'; //set status to 1
...
include 'status_0.php'; //after finished operation set status back to 0
} else { //if status is 1 say that its 1
echo "MySQL DB is in use (status ". $status .")";
die;
}
您缺少一个等号。 – Jon
'($ status ==“0”)'平等,不分配! –
使用“等号”符号:'if($ status ==“0”)' –