|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-12-19 11:10 UTC] shlomo dot v at zend dot com
Description:
------------
Problem using the pdo_ibm driver with PHP 5.6 and 7.
Following keywords not working with IBM i:
"I5_ATTR_DBC_SYS_NAMING" and "I5_ATTR_DBC_CURLIB"
$db_pdo_ibm = [
'driver' => 'pdo',
'dsn' => 'ibm:E00XX73X',
'username' => strtoupper('XXXXXX'),
'password' => strtoupper('xxxxxx'),
'driver_options' => [
PDO::ATTR_AUTOCOMMIT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING,
PDO::ATTR_PERSISTENT => false,
//PDO::I5_ATTR_DBC_SYS_NAMING => true,
// PDO::I5_ATTR_DBC_CURLIB => '',
PDO::I5_ATTR_DBC_LIBL => 'YOURLIB',
You need to qualify the SQL statement with the schema/library to avoid "Undefined object errors" else it will use the connected User Name as the database name.
Test script:
---------------
$db_pdo_ibm = [
'driver' => 'pdo',
'dsn' => 'ibm:E00XX73X',
'username' => strtoupper('XXXXXX'),
'password' => strtoupper('xxxxxx'),
'driver_options' => [
PDO::ATTR_AUTOCOMMIT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING,
PDO::ATTR_PERSISTENT => false,
//PDO::I5_ATTR_DBC_SYS_NAMING => true,
// PDO::I5_ATTR_DBC_CURLIB => '',
PDO::I5_ATTR_DBC_LIBL => 'YOURLIB',
Patcheskievlywm (last revision 2017-01-30 15:48 UTC by sample at email dot tst)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
PDO IBM Version 1.3.4sq4 tested with PHP 7 latest Zend Server 9.1.4 All seems to work on IBM i using the 'driver_options' => [PDO::I5_ATTR_DBC_SYS_NAMING => true, PDO::I5_ATTR_DBC_CURLIB => 'MY_LIB', PDO::I5_ATTR_DBC_LIBL => 'MY_LIB', ],