PDO and buffered queries
| From: | Larry Garfield | Date: | Thu, 29 Mar 2007 04:14:25 +0000 |
| Subject: | PDO and buffered queries | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-251597@lists.php.net to get a copy of this message | ||
HI all. The PHP.net manual is somewhat unclear on this point, so I thought
I'd ask here. Does PDO automatically buffer queries the way that the mysql_*
extension does, in order to allow multiple result sets open at the same time?
Or is that something that has to be set on the connection, and if so, is that
available for all drivers?
I ask because I am running into a problem with a query segfaulting on me, but
only under PHP 5.1 with PDO from pecl. It ran fine in PHP 5.2.0. The only
mention in the manual on this subject is:
http://us2.php.net/manual/en/ref.pdo-mysql.php
"If this attribute is set to TRUE on a PDOStatement, the MySQL driver will use
the buffered versions of the MySQL API. If you're writing portable code, you
should use PDOStatement::fetchAll() instead."
The sample code there suggests that nothing does buffered queries except the
MySQL driver. I find no mention of that anywhere else, though, one way or
another. Of course, using fetchAll(), as it suggests, means that I only get
arrays, not objects. (Unless I'm misreading those docs, too.)
Any PDO experts out there able to shed some light on the situation? I'm
thoroughly confused at this point, and the manual is quite unclear on all of
the important details I care about. :-)
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson