php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38922 Undefined class constant 'ATTR_DEFAULT_FETCH_MODE'
Submitted: 2006-09-22 09:42 UTC Modified: 2006-09-22 11:59 UTC
From: cogo at starzinger dot net Assigned: bjori (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.1.6 OS: Linux-2.6.17
Private report: No CVE-ID: None
 [2006-09-22 09:42 UTC] cogo at starzinger dot net
Description:
------------
I am trying to set a default fetch mode using the PDO::ATTR_DEFAULT_FETCH_MODE as mentioned on http://www.php.net/pdo. Trying to do this results in the error:

Undefined class constant 'ATTR_DEFAULT_FETCH_MODE'

Hopefully my code is correct. ;)

Reproduce code:
---------------
$pdo = new PDO('mysql:host=host;dbname=db', 'user', 'password', array(
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
));

Expected result:
----------------
I expect the code to connect to the mysql database and set FETCH_ASSOC as the default fetch mode.

Actual result:
--------------
Fatal error: Undefined class constant 'ATTR_DEFAULT_FETCH_MODE' in /path/to/my/script.php on line...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-22 11:54 UTC] bjori@php.net
Reclassified.

PDO::ATTR_DEFAULT_FETCH_MODE will be available as of 5.2.0
 [2006-09-22 11:59 UTC] bjori@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-2025 The PHP Group
All rights reserved.
Last updated: Fri Aug 01 11:00:02 2025 UTC