Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

odbc_connect fails to work with a remote dsn

General discussions related to php

Moderators: macek, egami, gesf

odbc_connect fails to work with a remote dsn

Postby handro1104 » Tue Mar 05, 2013 12:16 pm

This is my code:
Code: Select all
$DBNAME = "sluggo";
$DBUSER = "xxxx";
$DBPASSWD = "xxxxx";
$CONNECTION = odbc_connect ($DBNAME, $DBUSER, $DBPASSWD);

The database is a DB2 database in a Linux server. Connecting from the ODBC screen "CLI/ODBC Setting - sluggo" works fine, but I am getting a FALSE value for $CONNECTION.

Locally I am using Wamp; I put "php_ibm_db2.dll" in the ext folder of php and in the php.ini file I set "extension=php_ibm_db2.dll".

Your help will be greatly appreciated.
handro1104
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Mar 05, 2013 12:00 pm

Re: odbc_connect fails to work with a remote dsn

Postby johnj » Tue Mar 12, 2013 9:01 pm

are you sure that the database name, user name and password is correct?
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: odbc_connect fails to work with a remote dsn

Postby johnj » Tue Mar 12, 2013 9:04 pm

Please read about odbc_error() and trap that error.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron