php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47737 PDO constants page needs note re FETCH_KEY_PAIR
Submitted: 2009-03-20 19:59 UTC Modified: 2009-03-26 01:18 UTC
From: dan dot franklin at pearson dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Red Hat Enterprise Linux 5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dan dot franklin at pearson dot com
New email:
PHP Version: OS:

 

 [2009-03-20 19:59 UTC] dan dot franklin at pearson dot com
Description:
------------
The PDO documentation page that lists the predefined constants,
/manual/en/pdo.constants.php, should note in the description of 
PDO::FETCH_KEY_PAIR that this feature was added in PHP 5.2.3.

See the NEWS in the source distribution for 5.2.8, for example.


Reproduce code:
---------------
function test()
{
    $dbh = new PDO("mysql:host=$GLOBALS[DEV_HOST];dbname=Fen", "fen", "xxxxxxx");
    $stmt = $dbh->prepare("select * from islands order by island_id");
    $stmt->execute();
    return $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
}
var_dump(test());


Expected result:
----------------
I expected to get a returned array where the first column was the key of each array element.

Actual result:
--------------
In PHP 5.1.6, attempts to use PDO::FETCH_KEY_PAIR result in
PHP Fatal error:  Undefined class constant 'FETCH_KEY_PAIR' 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-26 01:18 UTC] kalle@php.net
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.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 04:00:02 2026 UTC