2 Replies - 1277 Views - Last Post: 29 September 2011 - 11:50 AM Rate Topic: -----

#1 VolcomMky  Icon User is offline

  • D.I.C Regular

Reputation: 74
  • View blog
  • Posts: 315
  • Joined: 13-May 09

MSSQL(mssql_connect) Issue

Posted 28 September 2011 - 10:46 AM

I Figured out the issue
Mod can remove if wish
=================================================


Not sure if this is a PHP Issure or a SQL Server Issue. Please move if need be.

I am having an issue connecting to SQL Server 2005 on a office computer from a website.

At first I was having issues and learned I had to install php_mssql and feetds on the website server.

Now that the mssql_connect is a installed function it started giving me a "Login Failed For User '****'" and a "Unable to connect to server: *.*.*.*"

So I created a new User through SQL Server Express on the host computer for the specified Database.

Still, got the same error for the new user.

So I switched to the local computers Username and Password and was no longer getting the Login Failed Error, but am still receiving the "Unable to connect to server: *.*.*.*"
<?
$server = '*.*.*.*';
$link = mssql_connect($server, '****', '****');
if (!$link) {
    die('<br><br>Something went wrong while connecting to MSSQL');
}
?>

Any thoughts or suggestions?

This post has been edited by VolcomMky: 28 September 2011 - 11:20 AM


Is This A Good Question/Topic? 0
  • +

Replies To: MSSQL(mssql_connect) Issue

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3717
  • View blog
  • Posts: 5,981
  • Joined: 08-June 10

Re: MSSQL(mssql_connect) Issue

Posted 29 September 2011 - 03:04 AM

View PostVolcomMky, on 28 September 2011 - 05:46 PM, said:

I Figured out the issue

Might I ask what it was and how you fixed it?
Was This Post Helpful? 0
  • +
  • -

#3 VolcomMky  Icon User is offline

  • D.I.C Regular

Reputation: 74
  • View blog
  • Posts: 315
  • Joined: 13-May 09

Re: MSSQL(mssql_connect) Issue

Posted 29 September 2011 - 11:50 AM

The problem was with the ports

I was trying to connect with the default sql server port (1433), so while doing research I learned about the IP settings in the SQL Server Protocols Configuration which had port settings

The database I was trying to connect to was running on a different port (it was using a dynamic port) than the default and as soon as I changed my connection in the PHP it worked like a charm.
:sweatdrop:

This post has been edited by VolcomMky: 29 September 2011 - 11:51 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1