UPDATE `ps_product_lang`
SET
`description` = REPLACE(`description`, '<li><p>', '<li>')
以上代码未处理,并显示 0 Rows affected
但是,以下代码适用于受影响的某些行:
UPDATE `ps_product_lang`
SET
`description` = REPLACE(`description`, 'lip', 'li')
如何处理之前的代码?我想准确替换 <li><p>
最佳答案
你的问题与此类似。你可以看一下:
Update a column value, replacing part of a string
我认为您可能需要在 UPDATE
查询中添加 LIKE
和 WHERE
子句。像这样的事情:更新你的表
设置 url = REPLACE(url, 'http://domain1.com/images/', 'http://domain2.com/otherfolder/')
WHERE url LIKE ('http://domain1.com/images/%');
关于mysql - 无法处理带有特殊字符的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55603545/