CI_DB_forge::drop_table PHP Method

drop_table() public method

Drop Table
public drop_table ( string $table_name, boolean $if_exists = FALSE ) : boolean
$table_name string Table name
$if_exists boolean Whether to add an IF EXISTS condition
return boolean
    public function drop_table($table_name, $if_exists = FALSE)
    {
        if ($table_name === '') {
            return $this->db->db_debug ? $this->db->display_error('db_table_name_required') : FALSE;
        }
        if (($query = $this->_drop_table($this->db->dbprefix . $table_name, $if_exists)) === TRUE) {
            return TRUE;
        }
        $query = $this->db->query($query);
        // Update table list cache
        if ($query && !empty($this->db->data_cache['table_names'])) {
            $key = array_search(strtolower($this->db->dbprefix . $table_name), array_map('strtolower', $this->db->data_cache['table_names']), TRUE);
            if ($key !== FALSE) {
                unset($this->db->data_cache['table_names'][$key]);
            }
        }
        return $query;
    }