Bug #69817 [NEW]: constant ''MYSQL_ATTR_INIT_COMMAND' not available on php 7.0.0alpha1
From: progfr_list at gmx dot fr
Operating system: Windows 10
PHP version: 7.0.0alpha1
Package: PDO MySQL
Bug Type: Bug
Bug description:constant ''MYSQL_ATTR_INIT_COMMAND' not available on php 7.0.0alpha1
Description:
------------
i have the message Fatal error: Undefined class constant
'MYSQL_ATTR_INIT_COMMAND' in "F:\....\fonction.php
i have check the php.ini and php_pdo_mysql.dll is loaded
Test script:
---------------
<?php
$DB_host='localhost';
$DB_base='db_base';
$DB_user='userlog';
$DB_pass='password';
try {
$connStr = 'mysql:host='.$DB_host.';dbname='.$DB_base; //Ligne 1
$arrExtraParam= array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES
utf8"); //Error is in this line
$pdo = new PDO($connStr, $DB_user, $DB_pass, $arrExtraParam);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e) {
$msg = 'ERREUR PDO dans ' . $e->getFile() . ' L.' . $e->getLine() .
' : ' . $e->getMessage();
die($msg);
}
Expected result:
----------------
Connect successfull to the database
Actual result:
--------------
Fatal error message
--
Edit bug report at https://bugs.php.net/bug.php?id=69817&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69817&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69817&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69817&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69817&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69817&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69817&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69817&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69817&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69817&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69817&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69817&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69817&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69817&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69817&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69817&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69817&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69817&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69817&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69817&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69817&r=mysqlcfg
Thread (6 messages)
- progfr_list at gmx dot fr