Page 1 of 1

Call to undefined method mysqli::numrows()

Posted: 19 May 2017, 16:06
by JanMolendijk
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);

Call to undefined method mysqli::numrows()

Posted: 20 May 2017, 05:02
by 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

Call to undefined method mysqli::numrows()

Posted: 20 May 2017, 14:17
by JanMolendijk
I gave up & gonna use your comment-tree script
thanks for all the support