Title: Fatal error: Uncaught Error: mysqli_query()
Last modified: August 22, 2023

---

# Fatal error: Uncaught Error: mysqli_query()

 *  Resolved [banija](https://wordpress.org/support/users/banijadev/)
 * (@banijadev)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-mysqli_query/)
 * **Fatal error**: Uncaught Error: mysqli_query(): Argument #1 ($mysql) must be
   of type mysqli, bool given
 * Call stack:
    1. `mysqli_query()`
       wp-content/plugins/wptools/functions/functions_benchmark.php:
       185
    2. `wptools_test_mysql()`
       wp-content/plugins/wptools/functions/functions_benchmark.
       php:77
    3. `wptools_test_benchmark()`
       wp-content/plugins/wptools/functions/functions.php:
       1084
    4. `wptools_options_benchmark()`
       wp-includes/class-wp-hook.php:310
    5. `WP_Hook::apply_filters()`
       wp-includes/class-wp-hook.php:334
    6. `WP_Hook::do_action()`
       wp-includes/plugin.php:517
    7. `do_action()`
       wp-admin/admin.php:259

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [sminozzi](https://wordpress.org/support/users/sminozzi/)
 * (@sminozzi)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-mysqli_query/#post-16992973)
 * Hi Banija,
 * I’m working to discover why it doesn’t work on your server. I will improve the
   code and let you know later today
 * Cheers,
 * Bill
 *  Plugin Author [sminozzi](https://wordpress.org/support/users/sminozzi/)
 * (@sminozzi)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-mysqli_query/#post-16993138)
 * Hi again Banija
 * I’ve redesigned the function with improvements, including placing all database
   calls within a protected area and configured it to log any failures to the error_log
   file.
 * 
   This will prevent any fatal errors before record the error log.If there’s a 
   failure, you can check why in the ‘Dashboard => WP Tools => Show errors’.Additionally,
   perform a test to check for any issues in your databases using the‘Dashboard 
   => WP Tools => Check Mysql Tables’ menu.
 * You can download the new file here:
   [https://wptoolsplugin.com/functions_benchmark.zip](https://wptoolsplugin.com/functions_benchmark.zip)
 * 
   After download that, uncompress and upload (functions_benchmark.php) to this
   folder:wp-content/plugins/WP Tools/trunk/functions/
 * Please, let me know if that works on your server or more details about the error.
 * Cheers,
 * Bill
 *  Plugin Author [sminozzi](https://wordpress.org/support/users/sminozzi/)
 * (@sminozzi)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-mysqli_query/#post-16999243)
 * Hi Banija,
 * The new version (404) encapsulates benchmark database calls within a protected
   area using PHP Try-Catch. In the event of an error, including potential fatal
   errors, the system first logs the error to the error log file. Subsequently, 
   on our ‘Show Errors’ page, you can review the details of what went wrong with
   your database call.
 * Cheers,
 * Bill

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal error: Uncaught Error: mysqli_query()’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wptools_f5b713.svg)
 * [WP Tools Debug Log, Repair, Javascript errors, Jquery errors, Increase Maximum Limits, File Permissions, Transients, Error Log](https://wordpress.org/plugins/wptools/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wptools/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wptools/)
 * [Active Topics](https://wordpress.org/support/plugin/wptools/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wptools/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wptools/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [sminozzi](https://wordpress.org/support/users/sminozzi/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-mysqli_query/#post-16999243)
 * Status: resolved