PDO调用存储过程的问题
$GDBObj->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
连续调用两次
$pdo->query("select xxxxx");
$pdo->query("select yyyyyy");
没有问题
但是如果调用存储过程
$pdo->query("call xxxx");
$pdo->query("select yyyyy");
就会报错:
Fatal error: Uncaught exception 'PDOException' with message '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.'
作者: updd 发布时间: 2008-04-15
作者: ten789 发布时间: 2008-04-15
$Stmt = $pdo->query("call xxxx()");
$Info = $Stmt->fetchAll();
......
$Stmt2 = $pdo->query("select yyyyy");
$Stmt2->fetchAll();
还是报同样的错
作者: updd 发布时间: 2008-04-15
PDO可以这样么 没用过一直在用ZEND_DB
作者: ten789 发布时间: 2008-04-15
作者: ten789 发布时间: 2008-04-15
$Stmt2 = $pdo->query("select yyyyy", array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));试试吧 也许有用
作者: ten789 发布时间: 2008-04-15
作者: updd 发布时间: 2008-04-15
作者: meiZiNick 发布时间: 2008-05-01
作者: UltraBejing 发布时间: 2008-05-01
作者: Lepingbeta 发布时间: 2011-01-27