SQLSTATE[HY000]: 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.
在PHP的PDO(PHP Data Objects)扩展中,这个错误SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active通常发生在使用非缓冲查询(unbuffered queries)时,你尝试执行另一个查询,而前一个查询的结果集还没有被完全读取。
非缓冲查询允许你开始处理结果集的第一行,而不需要等待整个查询结果集都返回。然而,这意味着你不能在结果集完全读取之前执行另一个查询,因为这会导致上述错误。