php 执行事务的时候pdo出现问题,事务pdo
新版本的pdo会有这个问题:
general error: 2014 cannot execute queries while other unbuffered queries are active. consider using pdostatement::fetchall(). alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the pdo::mysql_attr_use_buffered_query attribute.' in。。。
意思是要么使用fetchall(),要么使用mysql_attr_use_buffered_query这个属性,前者不想那样用,因为担心占用内存,后者发现没效果。
$this->db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
参考博客:
http://www.flashj.cn/wp/pdo-transaction-err-in-php.html











