谁有update的语句,调试过的。。。。我的一直更新失败呀。。。。
function update($table, $array, $where = null) { //error_reporting(E_ALL ^ E_DEPRECATED); foreach ($array as $key => $val) { if (@$str == null) { $sep = ""; } else { $sep = ","; } $str .=join(",","{$key}") . "='" . $val . "'"; } $sql = "update {$table} set {$str}" .($where == null ? null : "where" . $where); $result=mysqli_query(connect(),$sql); return $result; }