0

I want to remove the string;

<p><span style="color: #008000;">-- Instant Download --</span></p>

from a the field description_short in the table ps_product_lang I have tried the following SQL query

update ps_product_lang set description_short = replace(description_short, ‘<p><span style="color: #008000;">-- Instant Download --</span></p>’, ‘’);

But I get the error message

"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>-- Instant Download --

’, ‘’)' at line 1"

I believe its the quotes and --< that may be the issue, does anyone know how to make the query work> Thanks

2 Answers 2

2

This is your code:

update ps_product_lang
    set description_short = replace(description_short, ‘<p><span style="color: #008000;">-- Instant Download --</span></p>’, ‘’);

The only problem that is obvious to me are the curly single quotes. Try replacing them with regular single quotes:

update ps_product_lang
    set description_short = replace(description_short, '<p><span style="color: #008000;">-- Instant Download --</span></p>', '');
Sign up to request clarification or add additional context in comments.

Comments

0

why not to do the replace by PHP and after update the full field in mysql? Maybe is not the most correct way, but it works and is easy and fast to code that solution.

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.