From 28392a12d39a2d94f7c39adabf3c108c790ec01a Mon Sep 17 00:00:00 2001 From: Michael Save Date: Mon, 27 Aug 2012 21:37:21 +1000 Subject: [PATCH] fix "unbuffered queries" bug (issue #75) --- README.md | 3 ++- inc/database.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 34fe3554..ec184813 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ Requirements 2. [mbstring](http://www.php.net/manual/en/mbstring.installation.php) (--enable-mbstring) 3. [PHP-GD](http://php.net/manual/en/book.image.php) -4. [PHP-PDO](http://php.net/manual/en/book.pdo.php) with appropriate [driver for your database](http://www.php.net/manual/en/pdo.drivers.php) (only MySQL is supported at the moment) +4. [PHP-PDO](http://php.net/manual/en/book.pdo.php) + (only MySQL is supported at the moment) We try to make sure Tinyboard is compatible with all major web servers and operating systems. Tinyboard does not include an Apache ```.htaccess``` file nor does diff --git a/inc/database.php b/inc/database.php index 0dcc66b2..6f68e7e4 100644 --- a/inc/database.php +++ b/inc/database.php @@ -49,8 +49,11 @@ function sql_open() { if (!empty($config['db']['dsn'])) $dsn .= ';' . $config['db']['dsn']; try { - $options = Array(PDO::ATTR_TIMEOUT => $config['db']['timeout']); - $options = Array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'); + $options = array( + PDO::ATTR_TIMEOUT => $config['db']['timeout'], + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true + ); if ($config['db']['persistent']) $options[PDO::ATTR_PERSISTENT] = true; return $pdo = new PDO($dsn, $config['db']['user'], $config['db']['password'], $options);