$hostname = "localhost";
$database = "RUTHLESS";
$user = "ruthless";
$password = "guessit123";
$conn_string = "DRIVER={IBM DB2 ODBC DRIVER - DB2COPY1};HOSTNAME=$hostname;PROTOCOL=TCPIP;UID=$user;PWD=$password;DATABASE=$database;";
$conn = db2_connect($database, $user, $password);
if ($conn) {
echo "Success";
db2_close($conn);
} else {
echo "failed ".db2_conn_errormsg();
}
上面的程序没有在浏览器窗口上显示任何东西???该代码似乎卡在 db2_connect() 函数上。