public function fetch_assoc_all($index = '', $resource = '') {

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

        // if only one argument was given
        // meaning that the first argument is either a valid resource or a pointer to an array taken from cache
        if ($resource == '' && $this->_is_result($index) || (is_integer($index) && isset($this->cached_results[$index]))) {

            // use the first argument as the actual resource
            $resource = $index;

            // consider first argument as skipped
            $index = '';

        }

        // 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 (

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

            // OR $resource is a pointer to an array taken from cache
            || (is_integer($resource) && isset($this->cached_results[$resource]))

        ) {

            // this is the array that will contain the results
            $result = array();

            // move the pointer to the start of $resource
            // if there are any rows available (notice the @)
            if (@$this->seek(0, $resource)) {

                // iterate through the records
                while ($row = $this->fetch_assoc($resource)) {

                    // if $index was specified and exists in the returned row, add data to the result
                    if (trim($index) != '' && isset($row[$index])) $result[$row[$index]] = $row;

                    // if $index was not specified or does not exists in the returned row, add data to the result
                    else $result[] = $row;

                }

            }

            // return the results
            return $result;

        }

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

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

        ));

    }