php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #56436 Allow PDO class to set defaut PDOStatement::Fetch mode
Submitted: 2005-07-02 18:04 UTC Modified: 2014-01-02 15:53 UTC
From: php dot net at sharpdreams dot com Assigned:
Status: Duplicate Package: *General Issues
PHP Version: 5_1 CVS-2005-07-02 (dev) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
13 + 20 = ?
Subscribe to this entry?

 
 [2005-07-02 18:04 UTC] php dot net at sharpdreams dot com
Description:
------------
The PDO class ought to have a "setDefaultFetchMode()" function that when called, sets all subsequent PDOStatements to have that fetch mode.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-03 10:42 UTC] akorthaus at web dot de
I second that. 

If not an implementing an extra function, one could implement an attribute to use with PDO::setAttribute (I'd prefer a function).
 [2005-08-30 23:25 UTC] wez@php.net
Won't be in 5.1, and quite possibly won't be implemented at all.
 [2005-09-01 09:28 UTC] akorthaus at web dot de
This is the only problem which prevents many people from using PDO itself. 

If you have 20 queries in one script and you don't use the default FetchMode, hardcoded in the PDO source, you have to spread 20 PDOStatement::setFetchMode() calls all over your code, which could be easily avoided if it was possible to set the default-FetchMode once in the script.

Or do you think everybody using PDO must use a wrapper-class?
 [2005-10-19 08:44 UTC] akorthaus at web dot de
There is another bug in the php bug-tracker, with more detailed information and a first patch to implement a PDO::setDefaultFetchMode() methode (incomplete):

http://bugs.php.net/bug.php?id=34909
 [2014-01-02 15:53 UTC] mike@php.net
-Package: PDO +Package: *General Issues
 [2014-01-02 15:53 UTC] mike@php.net
Dupe of closed bug #34909.
 [2014-01-02 15:53 UTC] mike@php.net
-Status: Suspended +Status: Duplicate -Assigned To: helly +Assigned To:
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Feb 20 16:01:26 2019 UTC