I'm getting an error in my logs. Not sure if there something wrong with the configuration or a bug. This is probably triggered by a customer trying to do a purchase.
```
[20-Sep-2023 18:58:42 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3 for query SELECT post_id, meta_key, meta_value FROM wp_postmeta
WHERE meta_key IN ('_price', '_regular_price', '_sale_price', '_price_NOK', '_regular_price_NOK', '_sale_price_NOK')
AND post_id IN () made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, KCO_Confirmation->confirm_order, kco_confirm_klarna_order, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_processing'), WP_Hook->do_action, WP_Hook->apply_filters, wc_update_total_sales_counts, do_action('woocommerce_recorded_sales'), WP_Hook->do_action, WP_Hook->apply_filters, WCML_Synchronize_Product_Data->sync_product_total_sales, WC_Data_Store->__call, WC_Product_Data_Store_CPT->update_product_sales, WC_Data_Store_WP->update_lookup_table, WC_Product_Data_Store_CPT->get_data_for_lookup_table, get_post_meta, get_metadata, get_metadata_raw, apply_filters('get_post_metadata'), WP_Hook->apply_filters, WCML_Multi_Currency_Prices->product_price_filter, WPML\FP\{closure}, call_user_func_array, WPML\FP\Logic::WPML\FP\{closure}, WCML_Multi_Currency_Prices->{closure}, WCML_Custom_Prices->get_product_custom_prices
```
Also these warnings precede the error with the same timestamp:
```
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price_NOK in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price_NOK in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_sale_price_NOK in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_sale_price_NOK in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price_NOK in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price_NOK in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_sale_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_sale_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_regular_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_sale_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_sale_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
[20-Sep-2023 18:58:42 UTC] PHP Warning: Undefined property: stdClass::$_price in /var/www/wp-site/wp-includes/class-wp-list-util.php on line 192
```
[28-Sep-2023 11:53:30 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3 for query SELECT post_id, meta_key, meta_value FROM wp_postmeta
WHERE meta_key IN ('_price', '_regular_price', '_sale_price', '_price_NOK', '_regular_price_NOK', '_sale_price_NOK')
AND post_id IN () made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, KCO_Confirmation->confirm_order, kco_confirm_klarna_order, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_processing'), WP_Hook->do_action, WP_Hook->apply_filters, wc_update_total_sales_counts, do_action('woocommerce_recorded_sales'), WP_Hook->do_action, WP_Hook->apply_filters, WCML_Synchronize_Product_Data->sync_product_total_sales, WC_Data_Store->__call, WC_Product_Data_Store_CPT->update_product_sales, WC_Data_Store_WP->update_lookup_table, WC_Product_Data_Store_CPT->get_data_for_lookup_table, get_post_meta, get_metadata, get_metadata_raw, apply_filters('get_post_metadata'), WP_Hook->apply_filters, WCML_Multi_Currency_Prices->product_price_filter, WPML\FP\{closure}, call_user_func_array, WPML\FP\Logic::WPML\FP\{closure}, WCML_Multi_Currency_Prices->{closure}, WCML_Custom_Prices->get_product_custom_prices
I'm guessing the error is 'post_id IN ()', since this is probably invalid SQL. Why the post_id is empty though, I do not know...
As this is a syntax error most likely something in the code is triggering it with the version of MySQL used.
Taking a second look again at your MySQL Version I can see you are using 8.0, are you able to as a quick test to drop down to an older version? If you can please let me know your results.
The topic ‘[Closed] Error in your SQL syntax: get_product_custom_prices’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.