Woocommerce 和 Yoast 产品搜索错误

问题描述

我一直在尝试在管理区域使用产品搜索,它以前工作正常,现在我收到此错误

SELECT disTINCT posts.ID as product_id,posts.post_parent as parent_id FROM mu05iq_posts posts
             LEFT JOIN mu05iq_wc_product_Meta_lookup wc_product_Meta_lookup ON posts.ID = wc_product_Meta_lookup.product_id
              LEFT JOIN mu05iq_wc_product_Meta_lookup parent_wc_product_Meta_lookup
             ON posts.post_type = 'product_variation' AND parent_wc_product_Meta_lookup.product_id = posts.post_parent 
            WHERE posts.post_type IN ('product','product_variation')
             AND (  ( ( posts.post_title LIKE '%fiber%') OR ( posts.post_excerpt LIKE '%fiber%') OR ( posts.post_content LIKE '%fiber%' ) OR ( wc_product_Meta_lookup.sku LIKE '%fiber%' )  OR ( wc_product_Meta_lookup.sku = "" AND parent_wc_product_Meta_lookup.sku LIKE '%fiber%' ) )) 
            
            
            ORDER BY posts.post_parent ASC,posts.post_title ASC
        

wordpress database error: [UnkNown column '1' in 'where clause']
SELECT COUNT( 1 ) FROM mu05iq_postMeta WHERE post_id IN( SELECT ID FROM mu05iq_posts WHERE post_type = 'product' ) && Meta_value = "1" AND Meta_key = '_yoast_wpSEO_is_cornerstone'

如果有人有任何想法,我将不胜感激。 感谢和问候。

解决方法

如果有人遇到此问题,这是数字海洋管理的数据库设置,当您创建数据库集群时,它会在全局 SQL 模式下设置一些设置,只需删除 ANSI_QUOTES。这解决了我的问题。