Number Rows返回null

时间:2017-05-07 22:52:34

标签: php

我正在处理使用分页脚本的成员列表,它给我以下错误

  

mysqli_num_rows()期望参数1为mysqli_result,给定为null

$stmt = $db->prepare("SELECT * FROM users");
$stmt->execute();
$result = $stmt->get_result();   
$count = mysqli_num_rows($result);

if ($count < 1) {        
    echo "<h1 class='text-center'>No Users</h1>";
} else {        
    $count = ceil($count / $per_page); 

0 个答案:

没有答案