我在这里张贴手动阅读很多类似的线程之后,但不解决我的问题,所以我需要MySQL的高手帮我找出什么地方错了这个查询:格式化MySQL查询:您的SQL语法中有错误;检查对应于你的MySQL服务器版本
的查询如下所示:
SELECT DISTINCT(p.ID), p.*, pm.*, t.*, tt.*, tr.*
FROM wp_posts p, wp_postmeta pm, wp_terms as t, wp_term_taxonomy as tt, wp_term_relationships as tr
'WHERE p.ID = pm.post_id
AND t.term_id = tt.term_id
AND tt.taxonomy = wpsc_product_category
AND tt.term_taxonomy_id = tr.term_taxonomy_id
AND tr.object_id = p.ID
AND p.post_type = wpsc-product
AND pm.meta_key != _wpsc_price
AND (p.post_title LIKE '%'\"some string to search\"'%'
OR p.post_content LIKE '%'\"some string to search\"'%'
OR pm.meta_value = '\"some string to search\"'
OR t.name LIKE '%'\"some string to search\"'%')
GROUP BY p.ID ORDER By p.ID '
我没有什么错的查询格式得到以下错误:
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 ''WHERE p.ID = pm.post_id AND t.term_id = tt.term_id AND tt.taxonomy = wpsc_produ' at line 1
在我的查询,我需要整合的字符串,而我是个迫切所以我不能完全改变PDO。我怎样才能解决这个错误?提前Thanx。
PS:我是本地服务器上运行,因此PHP的信息显示我关于MySQL服务器的信息,我想它的版本:
Client API version 5.5.29