我的数据库:
+-------+-------+
| test1 | test2 |
+-------+-------+
| 0 | 1 |
+-------+-------+
两列均设置为 tinyint(1),不为null,默认为0
$value1 = $mysqli->query("SELECT test1 FROM test");
$value2 = $mysqli->query("SELECT test2 FROM test");
if ($value1 == false){
echo 'Value1 is false';
}
elseif ($value1 == true){
echo 'Value1 is true';
}
if ($value2 == false){
echo 'Value2 is false';
}
elseif ($value2 == true){
echo 'Value2 is true';
}
输出为:“ Value1为trueValue2为true”
当我要输出“ Value1为假”和“ Value2为真”时
我是PHP的新手,所以也许我犯了一个愚蠢的错误,但是我检查了其他问题,仍然找不到答案