0

我在从 LAMP 连接到 DB2 系列时遇到问题。对此代码有任何想法吗?我无法连接。如何确认 iseries 驱动程序工作、已安装等。或者我的代码是否错误?提前致谢...

   $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);
4

0 回答 0