Problems with IBM DB2 and PHP

admin

Administrator
Staff member
Hi!

Thanks to one folk of this area who told how to compile successfully php4 with ibm db2 support, we have our system almost ready. It is an apache 1.3.12 server with php 4.0.2 as a loadable module and IBM DB2 6.1 installed as a developer client, so we have to access a remote DB2 server on a NT 4 machine.

We have an instance ('db2inst1', the default one) that seems to work fine, because we can catalog databases and access them using command line. Once connected, we can perform normal SQL and sql select's return right values from tables.

However, when we try to connect to that same database from a php script, we get the following error message:

Warning: SQL error; SQL state (random rubbish here) in SQL connect in /usr/local/httpd/htdocs/index2.php

The script is the following

<?
$connect = odbc_connect("ejb", "ejb", "ejb") or die("Cannot connect");
?>

The script escapes through the die condition, and note that SQL state in error message does not return a code number but random rubbish (it seems to be a fragment of RAM content).

Can anyone help me?

Thanks in advance
 
Back
Top