How to iterate over multiple result sets of a custom query?

自闭症网瘾萝莉.ら 提交于 2019-12-11 14:42:29

问题


I have a stored procedure in my mysql database which returns multiple query result sets. I want to access these results in my cakephp(V3.4) project using following code statements.

  $db = ConnectionManager::get('default');                  
        $stmt = $db->execute("call mydatasp($paramlist)");
        $result = array();                     
        try{
                do
                {
                    $rowset = $stmt->fetchAll('assoc');
                    $result[]=$rowset;
                } while($stmt->nextRowset());
            }
            catch(Exception $e){}

After execution of this code block, I m getting error as

[Cake\Error\FatalErrorException] Call to undefined method Cake\Database\Log\LoggingStatement::nextRowset()

How can I access these multiple query resultsets?

来源:https://stackoverflow.com/questions/51799029/how-to-iterate-over-multiple-result-sets-of-a-custom-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!