ODBC SQL Server and PHP

I want to make a connection for SQL database [2005] with PHP 5.2

I tried with this connection string.

$connection = odbc_connect("Driver={SQL Server};SERVER=xxxx;DATABASE=xxxx;", "xxxx", "xxxx");

this is working well on my local machine.
But when I put it in to my Windows server [also have PHP 5.2 support] it gives an error.

ODBC Error:: IM002 :: [unixODBC][Driver Manager]Data source name not found, and no default driver specified :: DRIVER={SQL Server};SERVER=xxxx;

Please help me...............

This information gives for my phpinfo() funtion.

ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library unixODBC
ODBC_INCLUDE -I/usr/include
ODBC_LFLAGS -L/usr/lib64
ODBC_LIBS -lodbc

Directive Local Value Master Value
odbc.allow_persistent On On
odbc.check_persistent On On
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 b 4096 b
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited

0 Replies

Recent Posts

in PHP Development