Jump to content

[SOLVED] mssql_connect() not connecting


knowram

Recommended Posts

I am getting a Warning: mssql_connect(): Unable to connect to server: error and when I look at the log from my router/firewall I don't even see an attempt to connect. Is there some configuration in the php.ini file I need to check or anywhere else? phpinfo() shows a mssql section so i assumed that it was installed correctly.

 

Thanks for the help.

Link to comment
Share on other sites

Here is the connect statement. I am having the problem connecting from a test server. The production server work great.

The production server is a windows server running IIS. My test box is an apple with Apache installed.

 

mssql_connect("idc01-netwug.associa.corp", "user", "password") or
 die ("Could not connect to database");
mssql_select_db("WhatsUp") or
die ("Could not select database");

 

Thanks for the help. I am out of ideas.

 

 

Link to comment
Share on other sites

All I cant figure is that you have your DB details wrong

 

This part of the code is an exact copy form the production server.

 

Can you try

mssql_connect("localhost", "user", "password")


See if this works.

You are trying to connect to a database on your server, right?

 

No the MSSQL server is a different box. Is there something in a configuration file somewhere that lets you connect to remote servers?

 

Thanks again for the help

 

Link to comment
Share on other sites

There are 5 different servers involved

Production web server / SQL server (virtual box)

Old production web server (to be decommissioned)

Test web server / Mysql server

1 SQL server

 

 

From the production box I can connect to the MySQL database and both MSSQL databases. From the old production box I can also connect to the MySQL and both MsSQL databases. But from the test box I can only connect to the MySQL server on its self.

 

And yes I have admin access to all these.

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.