Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改MySQL字符串列中的h标记_Mysql_Function_Replace_Tags - Fatal编程技术网

更改MySQL字符串列中的h标记

更改MySQL字符串列中的h标记,mysql,function,replace,tags,Mysql,Function,Replace,Tags,我有一个MySQL表,其中的列字段是以如下开头的字符串: <h2>texttext</h2>texttexttext.... <h2>text2text2</h2>texttexte...... 但它没有起作用 请让我知道我做错了什么 谢谢。将整个数据库转储到SQL文件。在任何文本编辑器中搜索替换。导入回。这应该是有效的。你犯了什么错误?(当然,假设您实际上只匹配了h2>,而不是其他内容,如tableh2>),您确定您的内容不是HTML编码的吗

我有一个MySQL表,其中的列字段是以如下开头的字符串:

<h2>texttext</h2>texttexttext....

<h2>text2text2</h2>texttexte......
但它没有起作用

请让我知道我做错了什么


谢谢。

将整个数据库转储到SQL文件。在任何文本编辑器中搜索替换。导入回。

这应该是有效的。你犯了什么错误?(当然,假设您实际上只匹配了
h2>
,而不是其他内容,如
tableh2>
),您确定您的内容不是HTML编码的吗?像
h2
而不是
h2>
UPDATE myTable 
SET column = REPLACE(column, 'h2>', 'h1>')