Call to undefined method mysqli::numrows()

Discuss coding issues, and scripts related to PHP and MySQL.
User avatar
JanMolendijk
Posts: 282
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 Posts: 805
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 Posts: 282
I gave up & gonna use your comment-tree script
thanks for all the support