Bug #55053 [NEW]: PDO::FECTH_KEY_PAIR doesn't work as expected
| From: | dmitry dot chirkin at gmail dot com | Date: | Tue, 14 Jun 2011 13:43:54 +0000 |
| Subject: | Bug #55053 [NEW]: PDO::FECTH_KEY_PAIR doesn't work as expected | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-161387@lists.php.net to get a copy of this message | ||
From:
Operating system: Linux
PHP version: 5.3.6
Package: *Database Functions
Bug Type: Bug
Bug description:PDO::FECTH_KEY_PAIR doesn't work as expected
Description:
------------
If you try to use $stmt->fetchAll(PDO::FETCH_KEY_PAIR) on result set with
more
than two columns, error occurs:
Warning: PDOStatement::fetchAll() [pdostatement.fetchall]: SQLSTATE[HY000]:
General error: PDO::FETCH_KEY_PAIR fetch mode requires the result set to
contain
extactly 2 columns.
But documentation says:
PDO::FETCH_KEY_PAIR (integer)
Fetch into an array where the 1st column is a key and all subsequent
columns are
values
There are should be no limit for columns.
Thanks
Expected result:
----------------
No error
Actual result:
--------------
Warning: PDOStatement::fetchAll() [pdostatement.fetchall]: SQLSTATE[HY000]:
General error: PDO::FETCH_KEY_PAIR fetch mode requires the result set to
contain
extactly 2 columns.
--
Edit bug report at http://bugs.php.net/bug.php?id=55053&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=55053&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=55053&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=55053&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=55053&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=55053&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=55053&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=55053&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=55053&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=55053&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=55053&r=support
Expected behavior: http://bugs.php.net/fix.php?id=55053&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=55053&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=55053&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=55053&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=55053&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=55053&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=55053&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=55053&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=55053&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=55053&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=55053&r=mysqlcfg