当我尝试激活小部件中的一个选项时,会出现此错误。我把它分成了多行,这样可能更容易复习。我希望能够很快为熟悉SQL的人修复代码。谢谢你的时间!
WordPress数据库错误:[您的SQL语法有错误;请查看与您的MySQL server版本对应的手册,以了解在“post\\u status=\'publish”和“post\\u type in(\'post\')GROUP BY ID或“at line 14”附近使用的正确语法]
SELECT ID as post_id,
SUM(x.facebook_shares+x.twitter_shares) as a,
SUM(x.facebook_shares - x.facebook_shares_start +x.twitter_shares - x.twitter_shares_start) as d
,post_title,
post_content FROM wp_top_stories x inner join wp_posts on ID=id_post
AND dt_day>\'2017-09-19\' WHERE ( (x.facebook_shares - x.facebook_shares_start +x.twitter_shares - x.twitter_shares_start) >0 )
post_status=\'publish\' AND post_type in (\'post\') GROUP BY ID ORDER BY d DESC LIMIT 0,5