PDO执行execute方法后无任何返回,通过try catch 得到如下异常信息

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sdutphp/article/details/78443106

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.

解决方法:

$stmt->closeCursor();

猜你喜欢

转载自blog.csdn.net/sdutphp/article/details/78443106