MySQL Forums
Forum List  »  Connector/ODBC

MyODBC PHP not a valid ODBC-Link resource
Posted by: Chris
Date: April 08, 2005 01:30PM

Hi,

I am running Apache 2, PHP4, unixODBC 2.2.11 and MyODBC 3.51.11 on Linux Redhat 9

I can connect to a MySQL database through ODBC by using isql; however when I try to connect in a PHP page I receive the error: "supplied argument is not a valid ODBC-Link resource".

I am migrating from MS SQL Server to MySQL and was using freeTDS as the ODBC driver for MS SQL Server. Everything was working fine with freeTDS and all I changed on the PHP side was the DSN name. I am trying to narrow down the problem and think it might be a PHP configuration issue. Do I need to configure PHP or Apache to use MyODBC?

See my odbc configuration files below. A point I should make is I have tried to turn on logging in odbc.ini, but nothing ever shows up in the log file.

Thanks in advance,

Chris


----------odbcinst.ini------------
[FreeTDS]
Description = FreeTDS
Driver = /usr/lib/libtdsodbc.so.0
Setup = /usr/lib/libtdsS.so.1
FileUsage = 1
CPTimeout =
CPReuse =

# Driver from the MyODBC package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/local/lib/libmyodbc3_r.so
Setup =
-----------------------------------

--------------odbc.ini--------------
[CHRIS_DSN]
Driver = MySQL
Description = MySQL ODBC 3.51 Driver DSN
SERVER = localhost
PORT = 3306
USER =
Password =
TraceFile = /home/chris/chris_dsn.log
Trace = 1
CommLog = 1
Debug = 1
Database = test_chris
OPTION = 4
SOCKET =
-----------------------------------

Options: ReplyQuote


Subject
Written By
Posted
MyODBC PHP not a valid ODBC-Link resource
April 08, 2005 01:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.