【发布时间】:2015-04-04 02:20:39
【问题描述】:
我需要一个 MySQL 语句从名为 post_content 的字段中的文本中删除以下字符串
例如字符串:[css3_grid id='gcse'],怎么办?
【问题讨论】:
-
这是列,而不是字段...
-
您应该删除 PHP 标记。
我需要一个 MySQL 语句从名为 post_content 的字段中的文本中删除以下字符串
例如字符串:[css3_grid id='gcse'],怎么办?
【问题讨论】:
你会想做这样的事情:
UPDATE table SET post_content = REPLACE( '[css3_grid id=\'gcse\']' , '' , post_content )
【讨论】:
使用REPLACE() 函数。
UPDATE table SET post_content = REPLACE(post_content, 'String: [css3_grid id=''gcse'']', '');
【讨论】: