PHP 8 error Fatal error: Uncaught TypeError: mysqli_num_rows(): Argument #1 ($) must be of type mysqli_result …

IT Tutorials

Hello everyone, today I will write about an error on PHP 8, after an php 7.4 upgrade.

After apache, php, etc I have noticed some errors in a few scripts like : Fatal error: Uncaught TypeError: mysqli_num_rows(): Argument #1 ($result) must be of type mysqli_result, bool given in …

With a few minutes internet research I found that if(mysqli_num_rows($VARIABLE)==0) must become if(!$VARIABLE || mysqli_num_rows($VARIABLE)==0) to work in PHP 8 .

Good luck !

1 Star2 Stars3 Stars4 Stars5 Stars (19 votes, average: 4.79 out of 5)
Loading...


Lost Password