ID:               47224
 Comment by:       techi at techi dot name
 Reported By:      contact at joycebabu dot com
 Status:           Assigned
 Bug Type:         PDO related
 Operating System: Windows
 PHP Version:      5.3.0alpha3
 Assigned To:      mysql
 New Comment:

Using 1002 instead of constant does not work either. Using 5.3.0 under

x64 Windows


Previous Comments:
------------------------------------------------------------------------

[2009-07-02 10:43:36] mg at artigo dot pl

A temporary solution is to use INT value (1002) instead of constant.

------------------------------------------------------------------------

[2009-06-02 12:15:28] daniz at rocketmail dot com

Looking into 

/ext/pdo_mysql/pdo_mysql.c I saw this:

/* {{{ PHP_MINIT_FUNCTION
 */
static PHP_MINIT_FUNCTION(pdo_mysql)
{
#if PDO_USE_MYSQLND
        REGISTER_INI_ENTRIES();
#endif

        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_USE_BUFFERED_QUERY",
(long)PDO_MYSQL_ATTR_USE_BUFFERED_QUERY);
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_LOCAL_INFILE",
(long)PDO_MYSQL_ATTR_LOCAL_INFILE);     
#ifndef PDO_USE_MYSQLND
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MAX_BUFFER_SIZE",
(long)PDO_MYSQL_ATTR_MAX_BUFFER_SIZE);
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_INIT_COMMAND",
(long)PDO_MYSQL_ATTR_INIT_COMMAND);
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_FILE",
(long)PDO_MYSQL_ATTR_READ_DEFAULT_FILE);
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_GROUP",
(long)PDO_MYSQL_ATTR_READ_DEFAULT_GROUP);
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_COMPRESS",
(long)PDO_MYSQL_ATTR_COMPRESS);
#endif
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_DIRECT_QUERY",
(long)PDO_MYSQL_ATTR_DIRECT_QUERY);
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_FOUND_ROWS",
(long)PDO_MYSQL_ATTR_FOUND_ROWS);
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_IGNORE_SPACE",
(long)PDO_MYSQL_ATTR_IGNORE_SPACE);

#ifdef PDO_USE_MYSQLND
        pdo_mysqlnd_zval_cache =
mysqlnd_palloc_init_cache(PDO_MYSQL_G(cache_size));
#endif
        
        return php_pdo_register_driver(&pdo_mysql_driver);
}



Meaning in short:
if not defined "PDO_USE_MYSQLND" -
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_INIT_COMMAND",
(long)PDO_MYSQL_ATTR_INIT_COMMAND);

else don't register that class? Does it's supposed to come from
somewhere else? I just moved the init_command into a simple query("SET
NAMES utf8"); to get rid of the error.

------------------------------------------------------------------------

[2009-05-22 04:06:55] christian dot gahlert at web dot de

Hi,

I just had the same problem. It occured because I installed the PDO
extension via pecl but forgot to also install PDO_MYSQL.

After I installed the PDO_MYSQL everything was fine.

I hope I could save someone some time :)
Chris

------------------------------------------------------------------------

[2009-04-25 15:35:53] j...@php.net

For some reason this (and some other) constants are only available when

mysqlnd driver is used.

------------------------------------------------------------------------

[2009-01-27 12:33:45] contact at joycebabu dot com

Description:
------------
The constant PDO::MYSQL_ATTR_INIT_COMMAND is not available.

Reproduce code:
---------------
try {
    $pdbo = new PDO("mysql:host=localhost;dbname=test", 'root', '',
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
}catch(PDOException $e){
    echo $e->getMessage();
}


Expected result:
----------------
A successful connection to the mysql database

Actual result:
--------------
Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in
D:\Projects\Apache\htdocs\mysite.com\httpdocs\include\define-vars.inc.php
on line 23


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47224&edit=1

Reply via email to