In Zend app, I use Zend\\Db\\TableGateway and Zend\\Db\\Sql to retrieve data data from MySQL database as below.
Model -
pu
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();