How to replace one string to another one in mysql including language setting ?
Example query for arabic language ( "ar" ) unfortunately it doesnt work 🙁
UPDATE
`wp_posts`
SET `post_contant` = REPLACE(`post_content`,'str1','str2')
FROM wp_posts
WHERE post_status = 'publish'
AND ID IN (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(description, '"ar";i:', -1), ';',1) FROM wp_term_taxonomy WHERE taxonomy = 'post_translations');
2
Answers
I have noticed that that query returns results not only numbers. So I need only ID numbers. How to remove all values which not are numbers ?
This is part of query used for ID IN () to get all ID numbers:
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(description, '"ar";i:', -1), ';',1) FROM
wp_term_taxonomy
WHEREtaxonomy
= 'post_translations'You have a small error in your codee, the first from clause is no valid