将odbc连接到LAMP php的iseries

时间:2013-06-19 19:32:58

标签: php db2 db2-connect

我遇到从LAMP连接到DB2 iseries的问题。有关此代码的任何想法?我无法连接它。如何确认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);

0 个答案:

没有答案