MySQL查询显示没有结果,直到我复制并粘贴,然后它获得1

时间:2013-09-09 21:37:18

标签: php mysql wordpress wpml

将WordPress与WordPress MultiLanguage一起使用。我注意到一个页面是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错误。我疯了吗?我错过了什么吗?

0 个答案:

没有答案