【发布时间】:2020-03-07 13:15:11
【问题描述】:
需要一个表的行数。
$st = $db->query("select count(*) from images");
$total = $st->rowCount();
echo $total;
结果 - 1
表images 有2430 行。
如何获取正确的行数?
【问题讨论】:
-
你正在使用 PDO ??
-
SELECT COUNT(*) AS cnt然后echo $st['cnt'] -
@EmanuelVintilă,您的代码生成
fatal error