入Zend\Db\Adapter\Exception\RuntimeException
档
\library\Zend\Db\Adapter\Driver\Pdo\Result.php:159
我的数据库设置代码是
array(
'db' => array(
'driver' => 'Pdo',
'pdodriver' => 'mysql',
'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
'buffer_results' => true
),
'username' => 'root',
'password' => '',
'host' => 'localhost',
'dbname' => 'db_name',
),
)
结果获取代码是
$statement = $this->sql->prepareStatementForSqlObject($select);
$results = $statement->execute();
我试过$results->buffer();
&& $results->rewind()
我的迭代代码就像
foreach ( $results as $result ){
// code goes here ..
}
....
foreach ( $results as $result ){
// code goes here ..
}