【发布时间】:2015-05-07 14:34:13
【问题描述】:
所以基本上我要做的是在一个名为"product_description" 的表中搜索,找到'name' 的行并在名称中搜索字符串Energy。
假设我有一种来自美国的名为能量饮料的产品。我知道如何搜索和替换能源:
$sql = "UPDATE product_description SET name = REPLACE(name, 'Energy', 'Best Energy')";
有没有办法搜索能源并将America 替换为Europe?
【问题讨论】:
-
update ... set foo=replace(...) where foo like '%America%'? -
在地缘政治方面,美国无法取代,欧洲也无法取代。这永远不会发生。