更新 public function updateIndex($data,$id) { if(is_array($data)){ $sql=''; foreach($data as $key=>$val) { $sql.=','.$key."='".$val."'";