Page 1 of 1

Can't access a DB2 database

Posted: Tue Feb 26, 2013 2:06 pm
by handro1104
I am trying a DSN-less connection
$DBNAME = 'DRIVER={IBM DB2 ODBC DRIVER};SERVER=sluggo.draper.com:5030;DATABASE=xxxx;';
$CONNECTION = odbc_connect ($DBNAME, $DBUSER, $DBPASSWD);
but I am getting a FALSE value.

Your help will be greatly appreciated.

Re: Can't access a DB2 database

Posted: Tue Feb 26, 2013 3:10 pm
by mecha_godzilla
Hi,

The IBM site would probably be a good place to start if you need some working examples:

http://www.ibm.com/developerworks/opens ... index.html
http://www.ibm.com/developerworks/data/ ... scott.html

PHP also has in-built functions for working with DB2 databases provided you can install the DB2 extension on your system:

http://www.php.net/manual/en/ibm-db2.requirements.php
http://www.php.net/manual/en/ibm-db2.installation.php
http://php.net/manual/en/ref.ibm-db2.php

HTH,

Mecha Godzilla