小编Joh*_*nny的帖子

在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;?>
}
?>
Run Code Online (Sandbox Code Playgroud)

为何无法正常工作,我错过了什么吗?

php mysql pdo

4
推荐指数
1
解决办法
2056
查看次数

标签 统计

mysql ×1

pdo ×1

php ×1