4
问题是我的总行数的输出结果没有显示出来。 我的实际代码:在pdo中获取多个选择
<?
$stmt = $dbh->prepare("SELECT SQL_CALC_FOUND_ROWS * FROM table WHERE mark=0 ORDER BY id ASC LIMIT 0, 15; SELECT FOUND_ROWS() as total;");
$stmt->execute();
if ($stmt->rowCount() > 0)
{
?>
<span>Number or rows: <? echo $stmt->total; ?></span>
<?
while($result = $stmt->fetch(PDO::FETCH_OBJ))
{
<?=$result->id;?>
<?=$result->user;?>
}
?>
可能是什么原因不工作,我错过了什么?
'$ stmt-> total'不存在。 – hjpotter92