#38922 [Opn]: Undefined class constant 'ATTR_DEFAULT_FETCH_MODE'

From: Date: Fri, 22 Sep 2006 11:54:40 +0000
Subject: #38922 [Opn]: Undefined class constant 'ATTR_DEFAULT_FETCH_MODE'
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969374071@lists.php.net to get a copy of this message
ID: 38922 Updated by: bjori@php.net Reported By: cogo at starzinger dot net Status: Open -Bug Type: PDO related +Bug Type: Documentation problem Operating System: Linux-2.6.17 PHP Version: 5.1.6 New Comment: Reclassified. PDO::ATTR_DEFAULT_FETCH_MODE will be available as of 5.2.0 Previous Comments: ------------------------------------------------------------------------ [2006-09-22 09:42:30] 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... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38922&edit=1

« previous php.doc (#969374071) next »