function update($table,$array,$where=null){
$link=mysqli_connect(DB_HOST,DB_USER,DB_PWD,DB_DBNAME) or die("数据库连接失败Error:".mysql_errno().":".mysql_error());
mysqli_set_charset($link,DB_CHARSET);
foreach($array as $key=>$val){
if ($str==null){
$sep="";
}else{
$sep=",";
}
$str.=$sep.$key."='".$val."'";
}
$sql="update {$table} set {$str} ".($where==null?null:" where ".$where);
$result=mysqli_query($link,$sql);
//var_dump($result);
//var_dump(mysql_affected_rows());exit;
if($result){
return mysqli_affected_rows();
}else{
return false;
}
}
$str是什么?