function update($table = '', $set = NULL, $where = NULL, $limit = NULL)
{
// Combine any cached components with the current statements
$this->_merge_cache();
if (!is_null($set)) {
$this->set($set);
}
if (count($this->ar_set) == 0) {
if ($this->db_debug) {
return $this->display_error('db_must_use_set');
}
return FALSE;
}
if ($table == '') {
if (!isset($this->ar_from[0])) {
if ($this->db_debug) {
return $this->display_error('db_must_set_table');
}
return FALSE;
}
$table = $this->ar_from[0];
}
if ($where != NULL) {
$this->where($where);
}
if ($limit != NULL) {
$this->limit($limit);
}
$sql = $this->_update($this->_protect_identifiers($table, TRUE, NULL, FALSE), $this->ar_set, $this->ar_where, $this->ar_orderby, $this->ar_limit);
$this->_reset_write();
return $this->query($sql);
}