Req #34714 [Opn->Csd]: set Default Fetch Mode in PDO class

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=34714&edit=1

 ID:                 34714
 Updated by:         [email protected]
 Reported by:        mcka at gmx dot net
 Summary:            set Default Fetch Mode in PDO class
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            PDO related
 Operating System:   *
 PHP Version:        5.1.0RC1
-Assigned To:        
+Assigned To:        tpunt
 Block user comment: N
 Private report:     N

 New Comment:

This was implemented soon after this report was opened. See the ATTR_DEFAULT_FETCH_MODE constant on the PDO::setAttribute() manual page[1].

[1]: http://php.net/manual/en/pdo.setattribute.php


Previous Comments:
------------------------------------------------------------------------
[2005-10-03 11:12:37] mcka at gmx dot net

Description:
------------
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:

PDO::setDefaultFetchMode()

or

PDO::setAttribute(PDO::DEFAULT_FETCH_MODE...)

you could set the fetch mode once in the script.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=34714&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.