public function loadNextObject($class = 'stdClass')
    {
        $this->connect();

        // Execute the query and get the result set cursor.
        if (!$this->executed) {
            if (!($this->execute())) {
                return $this->errorNum ? null : false;
            }
        }

        // Get the next row from the result set as an object of type $class.
        if ($row = $this->fetchObject(null, $class)) {
            return $row;
        }

        // Free up system resources and return.
        $this->freeResult();

        return false;
    }