Welcome Guest, Not a member yet? Register   Sign In
How to connect to Microsoft Sql Server 2005 with PHP
#1

[eluser]FutureKing[/eluser]
I am trying to connect to MS SQL Server 2005 with PHP using following code:
Code:
mssql_connect('SQL5.ZNETINDIA.NET','user','pass') or die(mssql_get_last_message());

BUT IT does not work.
I also tried to connect to my local sql server 2005 developer edition database But it also did not work.

Code:
mssql_connect('ANKURGUPTA-PC\SQLSERVER','user','pass') or die(mssql_get_last_message());

I get following error:
Code:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: SQL5.ZNETINDIA.NET in G:\websites\project.localhost\mssql.php on line 3

In the above code only username and password has been changed. Actual user name and password is not "user" and "pass".

I am 101% sure about my database server name, its username and password.

Is there any problem in my PHP configuration? I am using WAMP Server with php_mssql extension enabled.


mssql
MSSQL Support enabled
Active Persistent Links 0
Active Links 0
Library version 7.0

Directive Local Value Master Value
mssql.allow_persistent On On
mssql.batchsize 0 0
mssql.compatability_mode Off Off
mssql.connect_timeout 5 5
mssql.datetimeconvert On On
mssql.max_links Unlimited Unlimited
mssql.max_persistent Unlimited Unlimited
mssql.max_procs Unlimited Unlimited
mssql.min_error_severity 10 10
mssql.min_message_severity 10 10
mssql.secure_connection Off Off
mssql.textlimit Server default Server default
mssql.textsize Server default Server default
mssql.timeout 60 60


Messages In This Thread
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 10-13-2009, 05:18 AM
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 10-13-2009, 05:34 AM
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 10-13-2009, 09:17 AM
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 10-13-2009, 09:27 AM
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 10-13-2009, 07:19 PM
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 10-19-2009, 10:34 AM
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 10-22-2009, 02:40 AM
How to connect to Microsoft Sql Server 2005 with PHP - by El Forum - 01-05-2010, 08:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB