I am using this command without problems to replace class="texto1"
with class="texto2"
:
UPDATE tabela
SET estilo = REPLACE (estilo,'class="texto1"','class="texto2"')
WHERE estilo LIKE 'class="texto1"';
It works perfectly, but when I want to replace class="texto1" style="width:20px;margin-top:5px
that has a semicolon ;
I get this error message:
# 1064 - You have an error in your SQL syntax; check the manual that correspond to your MySQL server version for the right syntax to use near 'FROM' table 'WHERE 1' at line 1
The command used on the second attempt was this:
UPDATE tabela
SET estilo =
REPLACE (estilo,
'class="texto1" style="width:20px;margin-top:5px"',
'class="texto3"')
WHERE estilo LIKE '%class="texto1" style="width:20px;margin-top:5px"%';
What could be causing the error?