SQL Wordpress:要搜索标题中也有正则表达式的所有帖子,这些帖子也属于某个类别,然后将其添加到另一个类别中。
想用SQL而不用wordpress做到这一点。该类别称为“ 100岁以下”
SELECT * FROM wp_posts WHERE post_title REGEXP '^(\$|£|€).. |^..(\$|£|€) ' AND
INNER JOIN wp_term_relationships ON wp_term_relationships.object_id=wp_posts.ID
INNER JOIN wp_term_taxonomy ON wp_term_taxonomy.term_taxonomy_id=wp_term_relationships.term_taxonomy_id
INNER JOIN wp_terms ON wp_terms.term_id=wp_term_taxonomy.term_id
WHERE name = 'under 100'
UPDATE wp_term_relationships SET term_taxonomy_id = 263
啊,混乱不起作用