We stand alone,
together.
- BAND of BROTHERS
unbuffered queries are active问题
使用 PDOStatement->execute() 执行查询时出现错误:
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.
经过测试发现是因为在前一次 execute 里面执行了多条SQL语句(即通过分号分隔连续执行了多次的select/insert/update)。
看上去应该是 Pdo_Mysql 库本身存在的问题?没有找到比较好的解决方案。唯一比较笨的方法是:在执行了 multi-query 语句之后立即 closeConnection ,断开本次数据库连接。再下次查询之前先重新建立连接。这样 unbuffered queries 就被重置了。
1 条评论:
- linjiu () (link) 于 2009-11-18 00:59
http://www.pickyouruggs.com
日志存档
继续阅读
ac米兰 ajax apache api blog blogchina cctv css dhtml download dreamhost dvd encoding error feeds firefox flash framework gmail google google_analytics google_talk http ide ie ie7 javascript jquery linux maxthon mod_rewrite movies msn mvc mysql oracle php pippo pivot rss shell socket sohu spammers svn vs web web2 webclient weblogic windows xml zend 阿根廷 安全漏洞 奥运 备份 变形金刚 程序员 地铁 浮动层 搞笑 工具 冠军杯 管理 火箭 进程 客户端 篮球 厉 旅行 命令行 欧洲杯 人生 设计模式 世界杯 数据库 搜索引擎 算法 图片 无极 系统优化 笑话 姚明 游戏 源代码 周杰伦 字符编码 足球 浏览器

