<?
function exist_valid_att($tab,$account,$attname,$conn,$linkerror){
$query=mysql_query("select * from $tab where realname='$attname'",$conn)or die("$linkerror");
$row=mysql_fetch_object($query);
if($row->id!=""){
$i=explode(",",$row->getname);
$j=count($i);
for($k=0;$k<$j-1;$k++){
if($i[$k]==$account){
return $j-1;
}
}
}
else{
return 0;
}
}
function del_att($tab,$account,$att,$conn,$linkerror){
$i=explode(",",$att);
$j=count($i);
for($k=0;$k<$j-1;$k++){
$one=exist_valid_att($tab,$account,$i[$k],$conn,$linkerror);
if($one>0){
if($one==1){del();}
else{update();}
}
}
}
?>
del_att($tab,$getname,$att,$conn,$linkerror); 
       // 其中 $getname=liubi,$att="att1,att2,att3,";有没有更直接更好的办法!不胜感激!