gpt4 book ai didi

mysql phpmyadmin 替换包含问号的字符串

转载 作者:行者123 更新时间:2023-11-29 15:45:41 24 4
gpt4 key购买 nike

用新网址替换旧网址问题带问号

我尝试使用以下命令:

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com