全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
查看: 1654|回复: 2
打印 上一主题 下一主题

问个问题 PDO 老报错。。肿么回事啊!重金悬赏!

[复制链接]
跳转到指定楼层
1#
发表于 2014-4-22 14:55:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
数据库配置页
  1. db.<?php
  2. require './lib/dibi.min.php';

  3. // DB
  4. try {
  5.         $dsn = new PDO("mysql:host=localhost;dbname=runtime", 'root', '****', array(
  6.                 PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
  7.         ));

  8.         dibi::connect(array(
  9.                 'driver' => 'pdo',
  10.                 'pdo' => $dsn,
  11.                 'lazy' => true,
  12.                 'profiler' => array(
  13.                 'run' => TRUE,
  14.             ),
  15.         ));

  16.         $dibi = true;

  17. } catch (Exception $e) {
  18.         echo $e->getMessage();
  19.         exit();
  20. }

  21. ?>
复制代码


报错
http://up.vpsbar.im/tmp/exceptio ... 625fac44d0ec02.html

日志
  1. [2014-04-22 04-05-50] DibiDriverException: SQLSTATE[HY000]: 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. in /web/lib/dibi.min.php:1102  @  http://up.vpsbar.im/en/public  @@  exception-2014-04-22-04-05-50-f3cf5137b37058de5d269f6efb15af27.html
  2. [2014-04-22 04-05-59] DibiDriverException: SQLSTATE[HY000]: 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. in /web/lib/dibi.min.php:1102  @  http://up.vpsbar.im/en/public  @@  exception-2014-04-22-04-05-50-f3cf5137b37058de5d269f6efb15af27.html
  3. [2014-04-22 04-06-10] DibiDriverException: SQLSTATE[HY000]: 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. in /web/lib/dibi.min.php:1102  @  http://up.vpsbar.im/en/public  @@  exception-2014-04-22-04-05-50-f3cf5137b37058de5d269f6efb15af27.html
  4. [2014-04-22 04-06-19] DibiDriverException: SQLSTATE[HY000]: 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. in /web/lib/dibi.min.php:1102  @  http://up.vpsbar.im/en/public  @@  exception-2014-04-22-04-05-50-f3cf5137b37058de5d269f6efb15af27.html
  5. [2014-04-22 04-07-25] DibiDriverException: SQLSTATE[HY000]: 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. in /web/lib/dibi.min.php:1102  @  http://up.vpsbar.im/en/public  @@  exception-2014-04-22-04-05-50-f3cf5137b37058de5d269f6efb15af27.html
复制代码


求大神帮助! 散尽我的积分
2#
发表于 2014-4-22 16:29:15 | 只看该作者
给你谷歌翻译了一下
另外,如果你的代码是唯一永远要对mysql数据库方式运行,你可以通过设置PDO:: MYSQL_ATTR_USE_BUFFERED_QUERY属性启用查询缓存。
in /web/lib/dibi.min.php:1102

点评

感谢回复怎么给你加分?  发表于 2014-4-22 19:53
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-1-14 18:51 , Processed in 0.060264 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表