更新时间:2023-02-26 10:32:28
执行$sth->fetchColumn()
时,您将丢弃结果行.那不是您检查是否有任何结果的方法.你做
You're throwing away a result row when you do $sth->fetchColumn()
. That's not how you check if there's any results. you do
if ($sth->rowCount() > 0) {
... got results ...
} else {
echo 'nothing';
}