Call to undefined method mysqli::numrows()

User avatar
JanMolendijk
Posts: 107
Location: Holland Rotterdam

Call to undefined method mysqli::numrows()

I changed a php-mysql script to work with MySQLi, and now i getting this error:

Code: Select all

Fatal error: Call to undefined method mysqli::numrows() in /home/u790012824/public_html/Message/comments/inc_rate.php on line 181
line 181 is:

Code: Select all

$commentNum = $dbh->num_rows($results);

Admin
If you use object oriented style (with $dbh->), use the num_rows as a property (without "()" ), applied to the $results object.

Code: Select all

$commentNum = $results->num_rows;
Or, Procedural style:

Code: Select all

$commentNum = mysqli_num_rows($results);
- Documentation and examples: mysqli_result::$num_rows

JanMolendijk
I gave up & gonna use your comment-tree script
thanks for all the support

Similar Topics