[unixODBC-support] Problem between unixodbc and PHP5

Jean-Joseph YVON jj.yvon at dis-info.com
Tue Mar 27 17:07:10 BST 2012


First, sorry for my english.

I need to creat an ODBC connection to a SQL Server for a web service in WINDEV
I am running unixODBC on an ubuntu server 11.10 X64, i have installed unixODBC and freeTDS with apt-get.
I have edited  odbcinst.ini like this :

Trace           = Yes
TraceFile       = /var/log/odbc.log
ForceTrace      = Yes
Debug           = Yes
DebugFile       = /var/log/odbc.bug

Description     = TDS driver
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup          = /usr/lib/odbc/libtdsS.so
CPTimeout      =
CPReuse        =
FileUsage       = 1

I have edited  odbc.ini like this :
[ODBC Data Sources]
MSZIMO          = mssql server

Driver          = /usr/lib/odbc/libtdsodbc.so
Description     = ODBC connection via FreeTDS
Trace           = No
#Servername     = MSSQL
Server          =
Port            = 1433
TDS_Version     = 7.0
Database        = NEWZIMMO

I have used this command for a test :
isql -v MSZIMO login password
and  i can connect to my database

When i test from My web service or a php script i see no connection in log.
The php scrip i use for testing :

echo "Connexion...<br>";
# connect to a DSN "MSZIMO"
$connect = odbc_connect("MSZIMO", "login", "password");
#result ID
echo $connect;
# query the agence table for all fields
$query = "SELECT * FROM agence";
echo $query;
# perform the query
$result = odbc_exec($connect, $query);
echo $result;
# close the connection

Someone could help me ?
I don't see what i am doing wrong.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20120327/8d10d027/attachment.html>

More information about the unixODBC-support mailing list