downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MySQL (PDO)> <Informix (PDO)
[edit] Last updated: Fri, 25 May 2012

view this page in

PDO_INFORMIX DSN

(PECL PDO_INFORMIX >= 0.1.0)

PDO_INFORMIX DSNInformix データベースに接続する

説明

PDO_INFORMIX データソース名 (DSN) は、Informix ODBC DSN 文字列を基にしています。 Informix ODBC DSN の設定についての詳細は、 » Informix Dynamic Server Information Center にあります。PDO_INFORMIX DSN の主要な部分は以下のようになります。

DSN 接頭辞

DSN 接頭辞は informix: です。

DSN

DSN は、odbc.ini を使用したデータソース設定、あるいは完全な » 接続文字列 のいずれかです。

例1 odbc.ini を使用した PDO_INFORMIX DSN の例

以下の例は、odbc.ini で Infdrv33 として登録されている Informix データベースに接続するための PDO_INFORMIX DSN を表します。

$db = new PDO("informix:DSN=Infdrv33", "", "");
[ODBC Data Sources]
Infdrv33=INFORMIX 3.3 32-BIT

[Infdrv33]
Driver=/opt/informix/csdk_2.81.UC1G2/lib/cli/iclis09b.so
Description=INFORMIX 3.3 32-BIT
Database=common_db
LogonID=testuser
pwd=testpass
Servername=ids_server
DB_LOCALE=en_US.819
OPTIMIZEAUTOCOMMIT=1
ENABLESCROLLABLECURSORS=1

例2 接続文字列を使用した PDO_INFORMIX DSN の例

以下の例は、common_db という名前の Informix データベースに接続文字列を使用して接続するための PDO_INFORMIX DSN を表します。

$db = new PDO("informix:host=host.domain.com; service=9800;
    database=common_db; server=ids_server; protocol=onsoctcp;
    EnableScrollableCursors=1", "testuser", "tespass");



add a note add a note User Contributed Notes PDO_INFORMIX DSN
phanx at phanx dot com 07-Jan-2010 01:56
When connect to the Dynamic Informix Server, got this error log in apache's error log file:

[Wed Dec 30 12:44:11 2009] [error] [client 1.1.1.1] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE=HY000, SQLDriverConnect: -11005 [Informix][Informix ODBC Driver]Unspecified System Error =  -11005.' in /opt/webroot/informix.php:5\nStack trace:\n#0 /opt/webroot/informix.php(5): PDO->__construct('informix:host=l...', 'username', 'password')\n#1 {main}\n  thrown in /opt/webroot/informix.php on line 5

you should export correct INFORMIXDIR enviroment variable for root user and restart the web server.

and another error:
 
[Wed Dec 30 13:10:10 2009] [error] [client 1.1.1.1] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE=01S00, SQLDriverConnect: -11005 [Informix][Informix ODBC Driver]Invalid connection string attribute.' in /opt/webroot/informix.php:5\nStack trace:\n#0 /opt/webroot/informix.php(5): PDO->__construct('informix:host=l...', 'username', 'password')\n#1 {main}\n  thrown in /opt/webroot/informix.php on line 5

you should let your connection string in one line, without line feed.

 
show source | credits | sitemap | contact | advertising | mirror sites