php3 + apache + redhat + ibm db2
| From: | leekit | Date: | Wed, 23 Aug 2000 08:20:59 +0000 |
| Subject: | php3 + apache + redhat + ibm db2 | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2290@lists.php.net to get a copy of this message | ||
hi all,
i've some problems abt using php3 to connect db2 in redhat, can u pls give
me some advice?
****************************************************************************
************************
IBM DB2
--with-ibm-db2=DIR
Enables IBM DB2 support. The parameter to this option is the DB2 base
install directory and defaults to /home/db2inst1/sqllib
from http://www.php.net
****************************************************************************
************************
i've installed db2 and create an instance "db2inst" with password "ibmdb2"
and therefore i configure as follow:
./configure ... --with-ibm-db2=/home/db2inst/sqllib ...
after that, using phpinfo(), i can see that the setting of the part of
"ODBC/odbc" is as follow...
****************************************************************************
*************************
ODBC/odbc:
Unified ODBC Support active (compiled with IBM DB2)
allow_persistent: -1
max_persistent: -1
max_links: -1
****************************************************************************
*************************
then i use "db2sampl" to create a sample database under db2 command line
it works fine
so, i tried to create an php file to test for the connection
here is the code of my file:
****************************************************************************
*************************
<?
$db_database = "sample";
$db_user = "db2inst";
$db_passwd = "ibmdb2";
$a = odbc_pconnect($db_database, $db_user, $db_passwd);
print("a: $a");
?>
****************************************************************************
*************************
and here is what i see when i load the page:
****************************************************************************
*************************
Warning: SQL error: üåÿ??¿XÿÿÿÿIéE@?@Õz@, SQL state
db_dP?¿Ø db_d in SQLConnect in /var/www/servers/index.php3 on
line 7
a:
****************************************************************************
*************************
whats wrong with my code?
can u pls kindly give more detailed advice for such a newbie like me?
thx in advance!
leekit