public function update($data) { $table = $this->_table; $where = $this->_where; if ($table == '') { return; } foreach ($data as $k => $v) { $nv = mysql_real_escape_string($v); $line[] = "`{$k}`='{$nv}'"; } $lines = join(',', $line); $sql = "UPDATE {$table} SET {$lines} WHERE {$where}"; $result = mysql_query($sql); if (!$result) { ToolModel::error_log("ERROR_IN_SQL_UPDATE {$sql}\r\n"); } }