#34909 [NEW]: Defaut FetchMode for PDOStatements in PDO class
| From: | mcka at gmx dot net | Date: | Tue, 18 Oct 2005 15:07:48 +0000 |
| Subject: | #34909 [NEW]: Defaut FetchMode for PDOStatements in PDO class | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-86705@lists.php.net to get a copy of this message | ||
From: mcka at gmx dot net
Operating system: all
PHP version: 5.1.0RC3
PHP Bug Type: PDO related
Bug description: Defaut FetchMode for PDOStatements in PDO class
Description:
------------
If I don't want to use the PDO_FETCH_BOTH FetchMode (which returns an
array indexed by both column names and numbers), I have to pass my desired
FetchMode to every PDOStatement and/or fetch() call everywhere in the PHP
scripts!
So why not offer a methode in PDO class which sets the default FetchMode
only once in a script like PDO::setDefaultFetchMode(), or at least add an
attribute like PDO_DEFAULT_FETCH_MODE which could be set by
PDO::setAttribute(PDO_DEFAULT_FETCH_MODE...)?
Makes live much easier for people who don't want to use PDO_FETCH_BOTH,
but PDO_FETCH_ASSOC, PDO_FETCH_OBJ, PDO_FETCH_NUM... - without forcing
them to extend or wrap PDO AND extend or wrap PDOStatement to implement
something like that!
--
Edit bug report at http://bugs.php.net/?id=34909&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34909&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34909&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34909&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34909&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34909&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34909&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34909&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34909&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34909&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34909&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34909&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34909&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34909&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34909&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34909&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34909&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34909&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34909&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34909&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34909&r=mysqlcfg