Reputation: 910
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
Upvotes: 0
Views: 204
Reputation: 1
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.
Upvotes: 0
Reputation: 1269583
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>', '');
Upvotes: 2