Jump to content

MSSQL Connection Help. Can't connect to server.


paulferree

Recommended Posts

I'm getting a "Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: " message.  And I'm having a hard time trying to find a concise explanation on how to make the PHP MSSQL connection.

 

Im on windows server 2008.  The mssql line is uncommented in the ini file.  Whats next?  Do I need to install that Freetds stuff?

 

Thanks!

Paul

mssql_connect() will only work if you uncomment the

 

extension for php_mssql.dll  in php.ini

 

is how you connect

$mssql_connect = ("localhost", "username", "password");

$msdb = mssql_select_db("databasename", $msconnect);

 

But I ran a private server of a stolen game a while that used mssql and I didn't allow any remote connections nor did I have any username / passwords I just used standard windows authentication.

 

which means you connect like this

 

$msconnect = mssql_connect("YourIPgoesHere");

$msdb = mssql_select_db("DatabaseName", $msconnect);

 

simple as that.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.