NYCPHP Meetup

NYPHP.org

[nycphp-talk] $sth->fetch(PDO::FETCH_ASSOC); = Undefined class constant 'FETCH_ASSOC'

Alan T. Miller amiller at criticalmedia.biz
Tue Oct 18 00:55:23 EDT 2005


I have been playing around with the new PDO objects in PHP 5.1 and for 
some reason I cannot get any of the constants to work.  I have followed 
the examples to the wire but no matter what I try, I keep getting an 
error telling me that the constants are undefined. Anyone else have this 
problem so far? Any sugestions?

Statements such as: $sth->fetch(PDO::FETCH_ASSOC);  will always yield a 
simular error:

*Fatal error*: Undefined class constant 'FETCH_ASSOC'

My test code follows what you will find at:

http://php.planetmirror.com/manual/en/function.pdostatement-fetch.php

Alan



More information about the talk mailing list