문제

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