Title: Fatal Error
Last modified: May 6, 2026

---

# Fatal Error

 *  [Seth](https://wordpress.org/support/users/1seth/)
 * (@1seth)
 * [5 days, 21 hours ago](https://wordpress.org/support/topic/fatal-error-4979/)
 * Hello,
 * I am seeing this error when using this plugin on a site with W3 Cache. I understand
   you cannot test against all plugins and some interactions may occur. I’m just
   sharing this so you’re aware and maybe see a potential fix.
 * I am using W3 Cache with the Database Cache. It seems like this is impacting 
   your plugin or vice versa.
 * I’m using Version 1.6.1.
 *     ```wp-block-code
       [06-May-2026 11:49:18 UTC] PHP Fatal error:  Uncaught TypeError: mysqli_num_fields(): Argument #1 ($result) must be of type mysqli_result, true given in /var/www/html/example-com-live/wp-includes/class-wpdb.php:3876Stack trace:#0 /var/www/html/example-com-live/wp-includes/class-wpdb.php(3876): mysqli_num_fields()#1 /var/www/html/example-com-live/wp-includes/class-wpdb.php(785): wpdb->load_col_info()#2 /var/www/html/example-com-live/wp-content/plugins/w3-total-cache/DbCache_WpdbInjection_QueryCaching.php(230): wpdb->__get()#3 /var/www/html/example-com-live/wp-content/plugins/w3-total-cache/DbCache_WpdbNew.php(216): W3TC\DbCache_WpdbInjection_QueryCaching->query()#4 /var/www/html/example-com-live/wp-content/plugins/aaa-option-optimizer/src/class-database.php(199): W3TC\DbCache_WpdbNew->query()#5 /var/www/html/example-com-live/wp-content/plugins/aaa-option-optimizer/src/class-plugin.php(182): Progress_Planner\OptionOptimizer\Database::batch_insert()#6 /var/www/html/example-com-live/wp-includes/class-wp-hook.php(341): Progress_Planner\OptionOptimizer\Plugin->update_tracked_options()#7 /var/www/html/example-com-live/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()#8 /var/www/html/example-com-live/wp-includes/plugin.php(522): WP_Hook->do_action()#9 /var/www/html/example-com-live/wp-includes/load.php(1308): do_action()#10 [internal function]: shutdown_action_hook()#11 {main}  thrown in /var/www/html/example-com-live/wp-includes/class-wpdb.php on line 3876
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [Filip Ilić](https://wordpress.org/support/users/filipi/)
 * (@filipi)
 * [5 days, 21 hours ago](https://wordpress.org/support/topic/fatal-error-4979/#post-18900610)
 * Hi [@1seth](https://wordpress.org/support/users/1seth/) , 
   thanks for the detailed
   report!
 * Our plugin starts a database transaction with the keyword BEGIN, and W3TC’s database
   cache normally skips queries like this… but it has a tiny gap in how it detects
   them: it recognizes the equivalent keyword `START TRANSACTION` but not `BEGIN`.
   So our `BEGIN` slipped through, W3TC tried to cache it as if it were a regular
   query, and that’s where things blew up. I reproduced it locally with W3TC 2.9.4
   to confirm.
 * **Fix:** A single-line change in `src/class-database.php` – replace `BEGIN` with`
   START TRANSACTION` (semantically identical in MySQL). It will be in the next 
   release.
 * If you’d like to patch it yourself in the meantime, edit `wp-content/plugins/
   aaa-option-optimizer/src/class-database.php`, find this line (around line 199):
 * `$wpdb->query( 'BEGIN' );`
 * and change it to:
 * `$wpdb->query( 'START TRANSACTION' );`
 * Thanks again for the heads-up!

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-4979%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/aaa-option-optimizer/assets/icon.svg?rev=3324099)
 * [AAA Option Optimizer](https://wordpress.org/plugins/aaa-option-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/aaa-option-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/aaa-option-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/aaa-option-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/aaa-option-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/aaa-option-optimizer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Filip Ilić](https://wordpress.org/support/users/filipi/)
 * Last activity: [5 days, 21 hours ago](https://wordpress.org/support/topic/fatal-error-4979/#post-18900610)
 * Status: not resolved