Can't access a DB2 database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
handro1104
Forum Newbie
Posts: 2
Joined: Tue Feb 26, 2013 2:01 pm

Can't access a DB2 database

Post 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.
Your help will be greatly appreciated,

Alejandro Barrero
User avatar
mecha_godzilla
Forum Contributor
Posts: 375
Joined: Wed Apr 14, 2010 4:45 pm
Location: UK

Re: Can't access a DB2 database

Post 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
Post Reply