Title: SQL error in logs
Last modified: January 3, 2024

---

# SQL error in logs

 *  Resolved [user9876789](https://wordpress.org/support/users/user9876789/)
 * (@user9876789)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/sql-error-in-logs/)
 * On every product page I’m getting an error in the log. I updated to the latest
   version today. I rolled back to 4.3.0 but the warning still happens on every 
   product page load. Do you have any ideas how I can resolve this?
 *     ```wp-block-code
       "PHP message: WordPress database error 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 '1
   
                       )
   
                       AND
   
                       (
   
         ...' at line 5 for query 
   
                   SELECT blocks.id
   
                   FROM xxx_yith_wapo_blocks as blocks
   
                   WHERE
   
                       (
   
                           visibility IN 1
   
                       )
   
                       AND
   
                       (
   
                           id IN (
   
                                   SELECT id FROM xxx_yith_wapo_blocks
   
                                   WHERE vendor_id IN ('0')
   
                               )
   
                       )
   
                       AND
   
                       (
   
                           (
   
                               id IN (
   
                                   SELECT id FROM xxx_yith_wapo_blocks
   
                                   WHERE product_association = 'all'
   
                               )
   
                               OR
   
                               id IN (" while reading upstream
       ```
   

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

 *  [Facundo A.](https://wordpress.org/support/users/aranofacundo/)
 * (@aranofacundo)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/sql-error-in-logs/#post-17329498)
 * Hi there,
 * I tried to replicate the issue you mentioned in my local site with the latest
   version of the plugin, and it worked correctly.
 * So I suggest you try disabling all the plugins except for WooCommerce and our
   plugin and then check if the issue is solved.
 * If it’s solved, then you will need to re-enable the plugins, one at the time,
   until you find the one causing the issue.
 * We’ll remain at your disposal.
 *  Thread Starter [user9876789](https://wordpress.org/support/users/user9876789/)
 * (@user9876789)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/sql-error-in-logs/#post-17335368)
 * Thank you for testing, I have now found the cause. In case this helps someone
   else, the issue was happening on our dev site too so I installed Query Monitor
   there – it showed the database error, I expanded `YITH_WAPO_DB->yith_wapo_get_blocks_by_product()`
   to list out all the path it was taking and it listed a Woo plugin in there. When
   I disabled that and refreshed the error was gone. I will speak with those plugin
   developers.
 *  Plugin Support [Alessio Torrisi](https://wordpress.org/support/users/alessio91/)
 * (@alessio91)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/sql-error-in-logs/#post-17346265)
 * Hi there,
 * thank you for reaching-out the cause of the issue and share the information with
   us.
 * Have a nice day.

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

The topic ‘SQL error in logs’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-product-add-ons/assets/icon-128x128.gif?
   rev=3142291)
 * [YITH WooCommerce Product Add-Ons](https://wordpress.org/plugins/yith-woocommerce-product-add-ons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-product-add-ons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Alessio Torrisi](https://wordpress.org/support/users/alessio91/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/sql-error-in-logs/#post-17346265)
 * Status: resolved