Вопрос

I am trying to do a replace and am getting a 1064 error.

UPDATE `wp_posts` SET post_content = replace(post_content, ‘<p style="text-align: center">Click here to see more’, ‘<p style="text-align: center">See more’)

I am guessing I need to escape something...

Это было полезно?

Решение

I think you're just using the wrong apostrophe. Use ' instead of :

UPDATE `wp_posts` 
SET post_content = replace(post_content, 
    '<p style="text-align: center">Click here to see more', 
    '<p style="text-align: center">See more')

Другие советы

Indeed some "escapes" were necessary:

UPDATE `wp_posts` SET post_content = replace(post_content, '<p style=\"text-align: center\">Click here to see more', '<p style=\"text-align: center\">See more')

Hope this is what you were looking for!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top