#47737 [NEW]: PDO constants page needs note re FETCH_KEY_PAIR

From: Date: Fri, 20 Mar 2009 19:59:30 +0000
Subject: #47737 [NEW]: PDO constants page needs note re FETCH_KEY_PAIR
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2020@lists.php.net to get a copy of this message
From:             dan dot franklin at pearson dot com
Operating system: Red Hat Enterprise Linux 5.1
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  PDO constants page needs note re FETCH_KEY_PAIR

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' 


-- 
Edit bug report at http://bugs.php.net/?id=47737&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        http://bugs.php.net/fix.php?id=47737&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        http://bugs.php.net/fix.php?id=47737&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        http://bugs.php.net/fix.php?id=47737&r=trysnapshot60
Fixed in CVS:                        http://bugs.php.net/fix.php?id=47737&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47737&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=47737&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=47737&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=47737&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=47737&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=47737&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=47737&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=47737&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=47737&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=47737&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47737&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47737&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=47737&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=47737&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=47737&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=47737&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=47737&r=mysqlcfg



Thread (2 messages)

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