This result is a forward only result set, calling rewind() after moving forward is not supported - Zend

前端 未结 4 1872
难免孤独
难免孤独 2020-12-10 04:22

In Zend app, I use Zend\\Db\\TableGateway and Zend\\Db\\Sql to retrieve data data from MySQL database as below.

Model -

pu         


        
4条回答
  •  长情又很酷
    2020-12-10 05:17

    Sure, It looks like when we use Mysql and want to iterate $resultSet, this error will happen, b/c Mysqli only does forward-moving result sets (Refer to this post: ZF2 DB Result position forwarded?)

    I came across this problem too. But when add following line, it solved:

    $resultSet->buffer();
    

    but in this mentioned post, it suggest use following line. I just wonder why, and what's difference of them:

    $resultSet->getDataSource()->buffer(); 
    

提交回复
热议问题