We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Call to undefined method Phalcon\Db\Result\Pdo::nextRowSet()

Hi,everyone! I used Phalcon in my project. It had worked well until I moved my project from one server to another and updated Phalcon to the latest version. The following code which had worked very well throwed a fatal error.

    <?php
        $sql = "CALL p_get_question(".$question_id.",'".$answer_orderby."');";
        $myModel = new question();
        $query=$myModel->getReadConnection()->query($sql);

        $question_result=$query->fetchAll();

        if(count($question_result)!=1){
            $this->response->setStatusCode(404,"Not Found");
            $this->view->disable();
        }else{
            $this->view->question=$question_result[0];
            $query->nextRowSet();
            $this->view->question_supplement=$query->fetchAll();

         }  
         ?>

And the error:

    Fatal error: Call to undefined method Phalcon\Db\Result\Pdo::nextRowSet() in D:\visual studio projects\UtillYou\app\controllers\QuestionController.php on line 25

Anybody can help me? Thanks!



16.0k
Accepted
answer

nextRowSet() is missing from phalcon 2.0. You should submit a feature request on github since wasn't ported to 2.0.

https://github.com/phalcon/cphalcon/issues

https://github.com/phalcon/cphalcon/blob/master/phalcon/db/result/pdo.zep

If you're coming from Phalcon 1.3 you'll have to make some changes to your code to work with Phalcon 2.0, or stick with 1.3 for now.

You can directly call PDOStatement::nextrowset using getInternalResult do { //Handle each result set } while($resultSet->getInternalResult()->nextRowset() && $resultSet->getInternalResult()->columnCount()>0);