0

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

EricImprint
  • 177
  • 1
  • 1
  • 13

2 Answers2

2

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')
sgeddes
  • 62,311
  • 6
  • 61
  • 83
0

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!

Theo Orphanos
  • 1,417
  • 1
  • 19
  • 27