$str='春,夏,秋,冬';
$czpstr=explode(',',$str);
foreach($czpstr as $key=>$value){
$rr=$empire->fetch1("select * from {$dbtbpre}ecms_news where title='{$value}'");
if($rr[id]){
$empire->query("update {$dbtbpre}ecms_news set ttid=46,totaldown={$key} where id='$rr[id]'"); //ttid 标题分类ID
}
}
效果图: