mysqli_num_rows语句的问题

时间:2015-07-20 05:02:13

标签: php mysql mysqli

我很难弄清楚为什么/(?!^.).{11}|^.|.+/gm 变量出错了。我收到这个错误..

$numrows

这条线......

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given

正在制作我的其他声明"此主题不存在显示"。

我的$ numrows变量出了什么问题?

$numrows = mysqli_num_rows($stmt);

2 个答案:

答案 0 :(得分:2)

您正在混合面向对象& 程序风格。应该是 -

$numrows = $stmt->num_rows;

DOCS

答案 1 :(得分:2)

使用

$numrows = $stmt->num_rows;

Read this as well