PDO报错:Cannot execute queries while other unbuffered queries are active.
来源:互联网 发布:云计算技术与应用课程 编辑:程序博客网 时间:2024/06/06 02:20
错误信息:
Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run agains
t mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
也就是说,未结束之前的查询而再次查询,这样是会出错地,所以要释放掉之前的查询。
解决方法:
$configs = $this->config;// 解决方法就是增加这句$configs['params'][constant('PDO::MYSQL_ATTR_USE_BUFFERED_QUERY')] = true;if ($this->pconnect) {$configs ['params'] [constant ( 'PDO::ATTR_PERSISTENT' )] = true;}try {$this->link = new PDO ( $configs ['dsn'], $configs ['username'], $configs ['password'], $configs ['params'] );} catch ( PDOException $e ) {throw new exception ( $e->getMessage () );//exit('连接失败:'.$e->getMessage()); }
- PDO报错:Cannot execute queries while other unbuffered queries are active.
- PHP PDO Cannot execute queries while other unbuffered queries are active 错误的一种分析和处理
- yii General error: 2014 Cannot execute queries while other unbuffered queries are active
- ThinkPHP SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries
- ORA-01157报错"cannot identify/lock data file" ORA-01219:database not open:queries allowed on fixed
- CentOS 报错cannot execute binary file
- 笔记:Transfer Learning with Active Queries from Source Domain
- hierarchical queries
- media queries
- Media Queries
- Distance Queries
- Queries Gym
- Queries Gym
- Media Queries
- java.lang.IllegalArgumentException: Update/delete queries cannot be typed
- java.lang.IllegalArgumentException: Update/delete queries cannot be typed
- SQLite的 cannot commit - no transaction is active报错
- 执行shell脚本报错 cannot execute binary file
- Cocos2d提供的字体!共57种(有对照的字体图)
- Oracle 按相同数据连续统计
- How to Perfectly Uninstall iTunes 10/9
- Oracle Consulting Prices(Oralce顾问在国外的价码)
- C# 编程规范(逐步总结)
- PDO报错:Cannot execute queries while other unbuffered queries are active.
- 加密技术
- C#基础知识梳理系列二:C#的演绎大师:类型
- ASP.NET 关于FORM认证
- 关于ubuntu中gurb有关文件配置
- Android Property
- 1040 凑表达式
- java 解析xml
- 对Java接口和抽象类的认识及分析