Question

I am having issues connecting from a LAMP over to an DB2 iseries. Any thoughts on this code? I cannot get it to connect. How can I confirm that the iseries driver works, is installed, etc. Or is my code wrong? Thanks in advance...

   $db_name     = "mydatabase";
   $db_host        = "ip address";
   $db_user        = "user";
   $db_pass        = "mypass";
   $dsn =         "DRIVER={iSeries Access ODBC Driver};" . 
                  "CommLinks=tcpip(Host=$db_host);" . 
                  "DatabaseName=$db_name;" . 
                  "uid=$db_user; pwd=$db_pass";

   $odbc = odbc_connect($dsn, $db_user, $db_pass);

     if (!$db = odbc_connect ($dsn, $db_user, $db_pass)) echo 'Error!';
     else echo 'Success!';


     $res400 = odbc_columns($odbc, "mylibrary", "%", "myfile", "%") or die(odbc_errormsg());

     echo odbc_result_all($res400);

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top