将 WordPress 与 WordPress 多语言一起使用。我注意到一个页面是 404ing,所以我转储了正在输出的查询,并得到以下内容(格式与下面完全相同):
SELECT newsite_posts.* FROM newsite_posts JOIN newsite_icl_translations t ON newsite_posts.ID = t.element_id
AND t.element_type = 'post_sectors' JOIN newsite_icl_languages l ON t.language_code=l.code AND l.active=1 WHERE 1=1 AND newsite_posts.post_name = 'advisory-practice' AND newsite_posts.ID = 456 AND newsite_posts.post_type = 'sectors' AND t.language_code='es' ORDER BY newsite_posts.post_date DESC
在 PHPMyAdmin SQL 选项卡中抛出它,得到 0 个结果。在它说“MySQL返回一个空的结果集”的部分下方,它为我重新输出了我的查询,格式如下:
SELECT newsite_posts. *
FROM newsite_posts
JOIN newsite_icl_translations t ON newsite_posts.ID = t.element_id
AND t.element_type = 'post_sectors'
JOIN newsite_icl_languages l ON t.language_code = l.code
AND l.active =1
WHERE 1 =1
AND newsite_posts.post_name = 'advisory-practice'
AND newsite_posts.ID =456
AND newsite_posts.post_type = 'sectors'
AND t.language_code = 'es'
ORDER BY newsite_posts.post_date DESC
所以我复制并粘贴回 phpmyadmin 的 SQL 选项卡,它可以工作,找到 1 行。这是完全相同的查询,格式不同。这里发生了什么?这也影响了我的代码,它不仅仅是一个 phpmyadmin 错误。我疯了吗?我错过了什么吗?