1

In following sql query I get an error on replace row. What is wrong I do not get. Probably phpmyadmin does not work with ' single code. I also try ` does not work eather.

Does someone has a solution for this?

UPDATE   `wp_postsbck` 
SET `post_content` =  REPLACE(
'<p style="font-size: 17px; line-height: 27px; margin-top: 10px;">',
'<p>')
WHERE
`guid` = 'http://xxxx/?page_id=329'

Tryed this also:

UPDATE   `wp_postsbck` 
SET `post_content` =  REPLACE(
'<p style=\"font-size: 17px; line-height: 27px; margin-top: 10px;\">',
'<p>')
WHERE
`guid` = 'http://xxxx/?page_id=329'

Thanks

Oeps... I forgot a part! Sorry first part (field) not written.

2
  • 2
    REPLACE takes three arguments. You have only supplied two. See the MySQL reference here Commented Jul 17, 2015 at 8:18
  • So it should be SET post_content = REPLACE(post_content, '<p style="font-size: 17px; line-height: 27px; margin-top: 10px;">', '<p>') Commented Jul 17, 2015 at 8:39

2 Answers 2

1

As seen in manual the right syntax of the REPLACE function is:

REPLACE(str,from_str,to_str)

so you need to provide 3 arguments to the function

Sign up to request clarification or add additional context in comments.

Comments

0

Thanks guys. I was blind! Complete forgotten the write 3 parts in statement. I will have a coffee break.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.