beemertec Posted October 15, 2019 Share Posted October 15, 2019 PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/xxxxxx/public_html/vcom/includes/functions/database.php on line 104 is showing up thousands of times in my error log. Here is line 103 and 104 of includes/functions/database.php function tep_db_num_rows($db_query) { return mysqli_num_rows($db_query); Any ideas? Link to comment Share on other sites More sharing options...
ArtcoInc Posted October 15, 2019 Share Posted October 15, 2019 @beemertec What version of PHP are you using? Link to comment Share on other sites More sharing options...
♥ecartz Posted October 16, 2019 Share Posted October 16, 2019 According to https://www.php.net/manual/en/mysqli.query.php the mysqli_query function returns false when it fails. False is a Boolean value. So it sounds like your database connection is failing. You could probably fix that particular warning by changing line 104 to something like return is_bool($db_query) ? false : mysqli_num_rows($db_query); But that won't fix the underlying problem. We might be able to give you more help if you could show us the first error that it gives on a page load. For debugging, you might try if (is_bool($db_query)) { error_log(print_r(debug_backtrace(), true)); error_log(print_r($db_query, true)); return false; } return mysqli_num_rows($db_query); That will clog your error log even more but may produce useful debugging information. Always back up before making changes. Link to comment Share on other sites More sharing options...
beemertec Posted October 16, 2019 Author Share Posted October 16, 2019 14 hours ago, ArtcoInc said: @beemertec What version of PHP are you using? I am using 5.6.40 (Zend: 2.6.0). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.