mySQL find replace not working

stargateatlantis
stargateatlantis used Ask the Experts™
on
I am trying the following SQL statment in mySQL but it isn't working not sure why

the table name is wp_posts

update wp_posts set post_content = replace('post_content', ‘http://dev.mydomain.com/’, ‘/’);

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Try
update wp_posts set post_content = replace(post_content, ‘http://dev.mydomain.com/’, ‘/’);

Open in new window


(no quotes around the column name post_content)
Top Expert 2012
Commented:
Try this:

update wp_posts set post_content = replace(post_content, 'http://dev.mydomain.com/', '/');

No quotes for post_content (or use backticks), use normal single quotes for the other parameters.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial