gpt4 book ai didi

php - WordPress 帖子查询正在提取修订结果作为结果

转载 作者:行者123 更新时间:2023-11-29 10:44:19 28 4
gpt4 key购买 nike

我有以下 WordPress 查询,该查询多次显示帖子标题,我已经检查过,它获取了每个帖子的所有修订。

这是查询:

SELECT DISTINCT post_title, ID 
FROM wpblog_posts
WHERE post_title LIKE '%Kimberley%'
OR post_title LIKE '%Camping%'
AND wpblog_posts.post_type = 'post'
AND post_status = 'publish'
ORDER BY post_title DESC LIMIT 0, 6;

任何人都知道为什么会发生这种情况。

Update

Removed from query string as not relevant and will make it easier to debug.

LEFT JOIN wpblog_term_relationships rel ON rel.object_id = wpblog_posts.ID 
LEFT JOIN wpblog_term_taxonomy tax ON tax.term_taxonomy_id = rel.term_taxonomy_id
LEFT JOIN wpblog_terms t ON t.term_id = tax.term_id

干杯

最佳答案

检查此查询是否适合您:

SELECT DISTINCT post_title, ID 
FROM wpblog_posts
WHERE (post_title LIKE '%Kimberley%' OR post_title LIKE '%Camping%')
AND wpblog_posts.post_type = 'post'
AND post_status = 'publish'
ORDER BY post_title DESC LIMIT 0, 6;

查询正在查找帖子 LIKE '%Kimberley%' - 任何类型的帖子或 LIKE '%Camping%' AND wpblog_posts.post_type = 'post' ....

关于php - WordPress 帖子查询正在提取修订结果作为结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44897729/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com