public function replace($table = '', $set = NULL)
{
if ($set !== NULL) {
$this->set($set);
}
if (count($this->qb_set) === 0) {
return $this->db_debug ? $this->display_error('db_must_use_set') : FALSE;
}
if ($table === '') {
if (!isset($this->qb_from[0])) {
return $this->db_debug ? $this->display_error('db_must_set_table') : FALSE;
}
$table = $this->qb_from[0];
}
$sql = $this->_replace($this->protect_identifiers($table, TRUE, NULL, FALSE), array_keys($this->qb_set), array_values($this->qb_set));
$this->_reset_write();
return $this->query($sql);
}