php mysql替换字符串方法

作者:袖梨 2022-06-24
 代码如下 复制代码


php
function replace(){
$sql = db_query("SELECT field_languages_value,nid FROM {content_type_company_profile} WHERE

field_languages_value like '%Mandarin Chinese%'");
while($result = db_fetch_object($sql)){
$a = explode("Mandarin Chinese",$result->field_languages_used_value);
$b = $a[].'Chinese'.$a[1];
db_query("UPDATE content_type_company_profile SET field_languages_used_value = '%s' WHERE nid = %

d",$b,$result->nid);
}
}
?>

相关文章

精彩推荐