我遇到从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);