Reputation: 2153
I use this to replace \"
with "
:
UPDATE wp_posts SET post_content = REPLACE (post_content, '\"', '"')
That query returns 0 row(s) affected
and nothing happens.
What is wrong this this query?
Upvotes: 2
Views: 2147
Reputation: 1409
The backslash charecter is escape character in MySQL so you need to escape it itself like this:
UPDATE wp_posts SET post_content = REPLACE(post_content, '\\"', '"')
Upvotes: 1
Reputation: 17610
You need to escape your backslash:
UPDATE wp_posts SET post_content = REPLACE (post_content, '\\"', '"')
Upvotes: 5