更新时间:2023-11-28 19:43:46
您需要将结果分配给变量,然后对该变量调用 empty()
.这只是 empty()
函数的一个令人讨厌的限制.参见此问题.
You need to assign the results to a variable, then call empty()
on the variable. It's just an annoying limitation of the empty()
function. See this question.
$results = $pQuery1->fetch(PDO::FETCH_ASSOC);
if (empty($results)){}