1
I am using this command smoothly to replace class="texto1"
for 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 semicolon ;
receive this 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 'FROM `table` WHERE 1' at line 1
The command used in 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 mistake?
I searched online tools of "Character escape" but none modified the stretch with semicolon.
– Wesley
Please specify your question, old text and text1?
– Roger Oliveira
I would like to replace 'class="texto1" style="width:20px;margin-top:5px' with 'class="texto3' but I get the error shown.
– Wesley
@Wesley: is it Mysql or SQL Server? The error message indicates Mysql but the sql-server tag is checked. Could you check?
– José Diz
@Josédiz is an sql database running in Lynx by Locaweb, I am layman on the subject, I removed the sql-server tag, I would like to make the change through phpmyadmin
– Wesley