CI_DB_query_builder::replace PHP Method

replace() public method

Compiles an replace into string and runs the query
public replace ( $table = '', $set = NULL ) : boolean
return boolean TRUE on success, FALSE on failure
    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);
    }