Pregunta

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...

¿Fue útil?

Solución

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')

Otros consejos

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!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top