I have to replace one string to another one in post_content column in table wp_post ( Wordpress ). My query works only then when I use SELECT but when I want to use UPDATE command with REPLACE then I have error. My query:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'str1', 'str2') FROM wp_posts WHERE ID IN (
SELECT ID
FROM wp_posts
WHERE ID IN (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(description, '"ar";i:', -1), ';',1) FROM wp_term_taxonomy WHERE taxonomy = 'post_translations'))
Mysql said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM wp_posts WHERE ID IN ( SELECT ID FROM wp_posts WHERE ID IN (SELECT S...' at line 1