用新网址替换旧网址问题带问号
我尝试使用以下命令:
UPDATE `kiss_texte` SET `kt_txt` = replace(kt_txt, 'xxx://www.hotelpronto.com/?affiliateid=30606\', 'xxx://stohler.ch/promo/liste-promotion.php?local=fr');
error: #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 'xxx://stohler.ch/promo/liste-promotion.php?local=fr')' at line 1
或
UPDATE `kiss_texte` SET kt_txt = REPLACE(kt_txt, 'xxx://www.hotelpronto.com/?affiliateid=30606\', 'xxx://stohler.ch/promo/liste-promotion.php?local=fr') WHERE `kt_txt` LIKE 'http://www.hotelpronto.com/?aff ttttttttiliateid=30606\';
error: #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 'xxx://stohler.ch/promo/liste-promotion.php?local=fr') WHERE `kt_txt` LIKE 'http' at line 1
问号似乎没有被解释为文本
最佳答案
为什么要使用前面的 \
转义单引号 '
?
UPDATE `kiss_texte` SET `kt_txt` = replace(kt_txt, 'xxx://www.hotelpronto.com/?affiliateid=30606', 'xxx://stohler.ch/promo/liste-promotion.php?local=fr');
如果您仍然需要尾部反斜杠,那么您必须使用双斜杠进行转义,例如 \\
关于mysql phpmyadmin 替换包含问号的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57079896/