public function get_columns($resource = '') {

        // if no active connection exists, return false
        if (!$this->_connected()) return false;

        // if no resource was specified, and a query was run before, assign the last resource
        if ($resource == '' && isset($this->last_result) && $this->last_result !== false) $resource = & $this->last_result;

        // if $resource is a valid resource
        if ($this->_is_result($resource)) {

            $result = array();

            // iterate through all the columns
            while ($column_info = mysqli_fetch_field($resource))

                // add information to the array of results
                // converting it first to an associative array
                $result[$column_info->name] = get_object_vars($column_info);

            // return information
            return $result;

        // if $resource is a pointer to an array taken from cache
        // return information that was stored in the cached file
        } elseif (is_integer($resource) && isset($this->cached_results[$resource])) return $this->column_info;

        // if $resource is invalid
        // save debug information
        return $this->_log('errors', array(

            'message'   => $this->language['not_a_valid_resource'],

        ));

    }