0

我收到此错误:

Error: 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.

你如何设置这个 PDO::MYSQL_ATTR_USE_BUFFERED_QUERY 属性?

4

1 回答 1

0

在http://docs.php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-use-buffered-query有一个例子:

$stmt = $db->prepare('select * from foo',
        array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));

(但如果这真的是一个很好的解决你的问题的方法是另一个问题......)

于 2012-08-02T09:31:09.387 回答