From 1e251d36b6dafeeafc3e1bea5b13bd9d6d10c8de Mon Sep 17 00:00:00 2001 From: James Collins Date: Wed, 10 Sep 2014 09:47:09 +0800 Subject: [PATCH] Fix query error when saving tax rates Fixes #6202 --- includes/admin/settings/class-wc-settings-tax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/admin/settings/class-wc-settings-tax.php b/includes/admin/settings/class-wc-settings-tax.php index d212ba869c5..7df9c93d632 100644 --- a/includes/admin/settings/class-wc-settings-tax.php +++ b/includes/admin/settings/class-wc-settings-tax.php @@ -723,7 +723,9 @@ class WC_Settings_Tax extends WC_Settings_Page { } } - $wpdb->query( "INSERT INTO {$wpdb->prefix}woocommerce_tax_rate_locations ( location_code, tax_rate_id, location_type ) VALUES " . implode( ',', $postcode_query ) ); + if ( !empty( $postcode_query ) ) { + $wpdb->query( "INSERT INTO {$wpdb->prefix}woocommerce_tax_rate_locations ( location_code, tax_rate_id, location_type ) VALUES " . implode( ',', $postcode_query ) ); + } }