I had a problem connecting to MS SQL 2005 with PHP.
I can connect from the shell using ...
tsql -S 10.0.0.134 -p 1433 -U gareth
Typing a simple query works as expected ...
1> SELECT @@VERSION AS MSSQL_VERSION 2> go MSSQL_VERSION Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86) Nov 24 2008 13:01:59 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.1 (Build 7601: Service Pack 1)
However, trying this with a PHP script does not work ...
$test = mssql_connect('10.0.0.134:1433', 'gareth', 'mypass');
... and creates mssql_connect () [function.mssql-connect]: cannot connect to server error.
I can see the mssql.so module in / usr / lib / php / modules and phpinfo () shows that the module is loaded.
I would be happy to use odbc_connect if someone could show me a configuration example for freetds.conf and odbc.conf
thanks
source share