I am trying to build a DSN to connect to an IBM-DB2 database on an AIX box using the PEAR database functions. PHP was successfully configured using the --with-ibm-db2 option.
The DSN syntax I am using comes from the PEAR documentation. I am not sure if I am using the correct DSN here nor am I sure that PEAR allows connections to DB2 databases. Has anyone been successful using PEAR with DB2 databases??
If PEAR is not possible, I would assume I need to use the Unified ODBC functions supplied with PHP. But what is the syntax for a DSN?? The PHP docs don't explain what the dsn string should look like!
Here's part of the code I was using:
<?php
require_once("pear/DB.php");
$user = "user";
$pass = "password";
$dbname = "archive";
$dsn = "odbc:/$user:$pass@$HTTP_HOST/$dbname";
$db = DB::connect($dsn, true);
$db->disconnect();
?>
Thanks in advance...