Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : ODBC and DB2 Functions (PDO_ODBC) : PDO_ODBC DSN

PDO_ODBC DSN

Connecting to ODBC or DB2 databases ()

Example 1664. PDO_ODBC DSN example (ODBC driver manager)

The following example shows a PDO_ODBC DSN for connecting to an ODBC database cataloged as testdb in the ODBC driver manager:

odbc:testdb

Example 1665. PDO_ODBC DSN example (IBM DB2 uncataloged connection)

The following example shows a PDO_ODBC DSN for connecting to an IBM DB2 database named SAMPLE using the full ODBC DSN syntax:

odbc:DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=localhost;PORT=50000;DATABASE=SAMPLE;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibmdb2;

Example 1666. PDO_ODBC DSN example (Microsoft Access uncataloged connection)

The following example shows a PDO_ODBC DSN for connecting to a Microsoft Access database stored at C:\db.mdb using the full ODBC DSN syntax:

odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\db.mdb;Uid=Admin

Code Examples / Notes » ref.pdo_odbc.connection

02-may-2006 03:57

On MS SQL Server there is a convenient way to help troubleshooting database server performance problems is to use the APP attribute, like this:
<?php
$dsn = 'DRIVER=FreeTDS;SERVERNAME=server1;DATABASE=testdb;APP=My PHP Application;UID=user;';
?>
This will show the "My PHP Application" text in ProgramName column of the sp_who2 procedure in MS SQL Server.


Change Language


Follow Navioo On Twitter
PDO_ODBC DSN
eXTReMe Tracker