For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > September 2006 > #38922 [Opn]: Undefined class constant 'ATTR_DEFAULT_FETCH_MODE'









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #38922 [Opn]: Undefined class constant 'ATTR_DEFAULT_FETCH_MODE'
bjori@php.net

2006-09-22, 7:57 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com