Fatal error: Uncaught mysqli_sql_exception
-
Have installed Query Monitor, and during Abandoned Cart Recovery for WooCommerce de/activation the following fatal error happens:
Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF' at line 1
in /public_html/wp-includes/class-wpdb.php on line 2357
Call stack:
mysqli_query()
wp-includes/class-wpdb.php:2357
wpdb::_do_query()
wp-includes/class-wpdb.php:2271
wpdb::query()
wp-includes/class-wpdb.php:3156
wpdb::get_results()
wp-admin/includes/upgrade.php:2998
dbDelta()
wp-content/plugins/woo-abandoned-cart-recovery/includes/plugin.php:120
WACV\Inc\Plugin::create_database()
wp-content/plugins/woo-abandoned-cart-recovery/includes/plugin.php:67
WACV\Inc\Plugin::single_active()
wp-content/plugins/woo-abandoned-cart-recovery/includes/plugin.php:62
WACV\Inc\Plugin::activate()
wp-content/plugins/woo-abandoned-cart-recovery/woo-abandoned-cart-recovery.php:114
WACVPInit_F::wacv_activate()
wp-includes/class-wp-hook.php:341
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:365
WP_Hook::do_action()
wp-includes/plugin.php:522
do_action()
wp-admin/includes/plugin.php:703
activate_plugin()
wp-admin/plugins.php:60The “IF NOT EXISTS” seems to be the culprit.
dbDelta( $query )should be doing that check already anyway.The suggested changes to
woo-abandoned-cart-recovery\includes\plugin.phpthat fixed the issue for me:$query = "CREATE TABLE IF NOT EXISTS {$abd_record_tb} // line ~92
to:
$query = "CREATE TABLE {$abd_record_tb}
$query = "CREATE TABLE IF NOT EXISTS {$guest_record_tb} ( // line ~124
to:
$query = "CREATE TABLE {$guest_record_tb} (
$query = "CREATE TABLE IF NOT EXISTS {$mail_log_tb} ( // line ~158
to:
$query = "CREATE TABLE {$mail_log_tb}
$query = "CREATE TABLE IF NOT EXISTS {$cart_log_tb} ( // line ~176
to:
$query = "CREATE TABLE {$cart_log_tb} (
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.