php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #968 iODBC Support Will not Connect to a non-local Database
Submitted: 1998-12-03 13:45 UTC Modified: 1999-02-16 07:39 UTC
From: mark at intrepid dot net Assigned:
Status: Closed Package: ODBC related
PHP Version: 3.0.5 OS: Linux 2.035 alpha unknown
Private report: No CVE-ID: None
 [1998-12-03 13:45 UTC] mark at intrepid dot net
I have PHP 3.0.5 compiled as a loadable Apache module, and have
compiled it with mysql and iODB support (iODBC 2.12).  The problem
is that the ODBC drivers connect to local data srouces, but will not connect to non-local data sources.

I have verified that the iODBC drivers are working correctly.  For example,
I have the following datasource defined:

   [world-remote]
   Trace    = Off
   TraceFile= stderr
   Driver   = /usr/lib/iodbc/lib/libmyodbc_mysql.so
   SERVER   = wchsys
   DSN      = world
   UID      = phpuser
   PWD      = php
   PORT     = 3306

and can query it with the bundled ODBC tools:

   [root@alpha lib]# odbctool -d world-remote "select * from county"
   <table border=1>
   <th>county</th>
   <th>view</th>
   <th>enable</th>
   <tr>
   etc....

However, when I try to connect via the PHP interface:

$odbc_result =   \    odbc_prepare(odbc_connect("world-remote","phpuser","php"),\
"select * from county");

I get a:

Warning: SQL error: [TCX][MyODBC]Unknown database 'world', SQL state
 08004 in SQLConnect in mytest2.php3 on line 2

error.

Now, this is the interesting part.  If I have a database "world" on the local
machine, I get a sucessful return.  In other words, the SERVER field is
being ignored in the ODBC initialization file.

I've posed the question severl times on the php mailing list, but have
recieved no response.

Thanks!

--Mark


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-02-16 07:39 UTC] kara
It looks to me the odbc.ini is screwed. The odbctool sample program
doesn't use the odbc.ini file, so the connect works.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 09:01:29 2024 UTC