【发布时间】:2020-04-05 11:16:57
【问题描述】:
我有一个表(实际上是由 WordPress 生成的)。我想使用REPLACE 函数替换一些文本,但它不起作用。
字段中的文本:
<!-- wp:blocks/amazon-product {"url":"https://www.amazon.com/OutdoorMaster-OTG-Ski-Goggles-Protection/dp/B01HLV5HR6","category":"1","headline":"OutdoorMaster OTG Ski Goggles - Over Glasses Ski/Snowboard Goggles for Men, Women \u0026 Youth - 100% UV Protection (Black Frame + VLT 10% Grey Lens with REVO Silver)","price":"$17.99","review":"",","checkPrice":"Buy Now on Amazon","isUrlPresent":true,"cacheDate":"2020-04-05T07:27:27.875Z"} /-->
这个文本完全是从字段中复制的,我尝试这样做:
UPDATE wp_posts
SET post_content =
REPLACE(
post_content,
'the above text',
'some new text'
)
WHERE ID = 1;
并且没有影响行,但是当我减少文本时,假设我只为<!-- wp:blocks/amazon-product {"url":"https://www.amazon.com/OutdoorMaster-OTG-Ski-Goggles-Protection/dp/B01HLV5HR6" 做,然后文本被替换。
【问题讨论】:
标签: mysql sql database wordpress