php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35452 PDO Constants are not defined
Submitted: 2005-11-28 16:44 UTC Modified: 2005-11-28 17:16 UTC
From: kang at respice dot de Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.1.0 OS: Win32 + Apache 2.0.55
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kang at respice dot de
New email:
PHP Version: OS:

 

 [2005-11-28 16:44 UTC] kang at respice dot de
Description:
------------
The PDO constants are not defined.

Reproduce code:
---------------
<?php print_r(get_defined_constants()); ?>
or
<?php
$DB = new PDO($dsn, $u, $p);
$DB->getAttribute(PDO_ATTR_CONNECTION_STATUS());
?>

Expected result:
----------------
PDO_* constants to be defined.
or
Connection status attribute.

Actual result:
--------------
Constants are not defined.
or
Error: type long expected, string provided.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-28 16:48 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Read release/upgrading notes.
 [2005-11-28 17:04 UTC] kang at respice dot de
Maybe I am a little slow here ;)
I activated the extensions (php_pdo.dll and php_pdo_mysql.dll) in the php.ini. The instantiation of the PDO base class is successfull.
If the extension is loaded, the constants should be defined, isn't it?
 [2005-11-28 17:16 UTC] tony2001@php.net
Did you read upgrade notes?
Ok, I can paste it here for you if don't want to do it:
"9b. Class constants in new PHP 5.1 extensions
=============================================

The Zend Engine 2.1 API allows extension developers to declare class constants
in object oriented extensions. New extensions written for PHP 5.1, including SPL,
PDO, ext/XMLReader and ext/date, have their constants in the format

PDO::CLASS_CONSTANT

rather than in the C format

PDO_CLASS_CONSTANT"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 20:01:29 2024 UTC