|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34714 set Default Fetch Mode in PDO class
Submitted: 2005-10-03 11:12 UTC Modified: 2017-03-29 12:42 UTC
Avg. Score:4.0 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: mcka at gmx dot net Assigned: tpunt (profile)
Status: Closed Package: PDO related
PHP Version: 5.1.0RC1 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mcka at gmx dot net
New email:
PHP Version: OS:


 [2005-10-03 11:12 UTC] mcka at gmx dot net
If you have a lot of queries in a script and you don't want to use the default PDO::FETCH_BOTH Mode (which returns an array with numbers and col-name indexes) - perhaps you want do use PDO::FETCH_OBJ or PDO::FETCH_ASSOC... - you have to set the fetch mode again and again for every query/statement.

If there would be something like:




you could set the fetch mode once in the script.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 21:46 UTC]
-Package: Feature/Change Request +Package: PDO related
 [2017-03-29 12:42 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: tpunt
 [2017-03-29 12:42 UTC]
This was implemented soon after this report was opened. See the ATTR_DEFAULT_FETCH_MODE constant on the PDO::setAttribute() manual page[1].

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 22:03:34 2021 UTC