|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #36157 Introduce new PDO attribute to automatically close old statement.
Submitted: 2006-01-25 16:59 UTC Modified: 2011-01-02 02:18 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: fh at ez dot no Assigned:
Status: Open Package: PDO related
PHP Version: 5.1.2 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: fh at ez dot no
New email:
PHP Version: OS:


 [2006-01-25 16:59 UTC] fh at ez dot no
Currently when using the MySQL PDO driver, trying to 
execute a second statement while the first one is still 
active yields: 
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 
This is all well and good, but quite unhandy since it is 
inconsistent with e.g the postgres driver that does not 
suffer from this problem. It also makes it very hard e.g 
wrap the result of an SQL statement in an iterator since 
the user might break out of it. 
I propose to introduce a new attribute to PDO that force 
the drivers to automatically "flush" any open statements 
when a new one is executed. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-02 02:18 UTC]
-Package: Feature/Change Request +Package: PDO related
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Aug 11 02:01:24 2020 UTC