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

From: Date: Wed, 29 Mar 2017 12:42:51 +0000
Subject: Req #34714 [Opn->Csd]: set Default Fetch Mode in PDO class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208146@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=34714&edit=1 ID: 34714 Updated by: tpunt@php.net 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

« previous php.bugs (#208146) next »