public function insert_id() {

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

        // if a query was run before, return the AUTO_INCREMENT value
        if (isset($this->last_result) && $this->last_result !== false) return mysqli_insert_id($this->connection);

        // if no query was run before
        // save debug information
        return $this->_log('errors', array(

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

        ));

    }