替换mysql中的字符串-href

替换mysql中的字符串-href,mysql,replace,Mysql,Replace,大家好! 在mysql数据库中,我如何更改 href=“/with href=”http://something/. “我对”有问题 谢谢。如果您想处理双引号问题,我认为您有两个简单的选择: UPDATE table SET column=REPLACE(column,'oldstring','newstring') 1) 将它们用单引号括起来,如下所示: UPDATE my_table SET my_field = 'href="http://mysite...something/' WHE

大家好! 在mysql数据库中,我如何更改 href=“/with href=”http://something/. “我对”有问题


谢谢。

如果您想处理双引号问题,我认为您有两个简单的选择:

UPDATE table SET column=REPLACE(column,'oldstring','newstring')
1) 将它们用单引号括起来,如下所示:

UPDATE my_table
SET my_field = 'href="http://mysite...something/'
WHERE my_field = 'href="http:/';
UPDATE my_table
SET my_field = "href=\"http://example.com/\""
WHERE my_field = "href=\"http:/";
2) 用这样的反斜杠来摆脱它们:

UPDATE my_table
SET my_field = 'href="http://mysite...something/'
WHERE my_field = 'href="http:/';
UPDATE my_table
SET my_field = "href=\"http://example.com/\""
WHERE my_field = "href=\"http:/";

你们都帮了我:更新我的表格设置我的字段=替换(我的字段,'href=“/”,'href=“mysite…something')谢谢!