Bug #55053 [Opn->Csd]: PDO::FECTH_KEY_PAIR doesn't work as expected

From: Date: Mon, 05 Dec 2011 22:33:35 +0000
Subject: Bug #55053 [Opn->Csd]: PDO::FECTH_KEY_PAIR doesn't work as expected
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7589@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55053&edit=1 ID: 55053 Updated by: frozenfire@php.net Reported by: dmitry dot chirkin at gmail dot com Summary: PDO::FECTH_KEY_PAIR doesn't work as expected -Status: Open +Status: Closed Type: Bug Package: Documentation problem Operating System: Linux PHP Version: 5.3.6 -Assigned To: +Assigned To: frozenfire Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2011-12-05 22:31:35] frozenfire@php.net Automatic comment from SVN on behalf of frozenfire Revision: http://svn.php.net/viewvc/?view=revision&revision=320468 Log: Changed the description of PDO::FETCH_KEY_VALUE to match actual behaviour (requiring the result set to have exactly two columns). Closes bug #55053. -- Provided by anonymous #11351 () ------------------------------------------------------------------------ [2011-06-14 15:43:53] dmitry dot chirkin at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=55053&edit=1

« previous php.doc.bugs (#7589) next »