troubleshooting Question

PHP 5.3.10 cannot connect to MSSQL 2008 database on server 2008

Avatar of CCC-Ravens
CCC-Ravens asked on
Microsoft SQL ServerPHPMicrosoft IIS Web Server
10 Comments1 Solution3494 ViewsLast Modified:
I have a new web server running PHP, IIS 7, and has MYSQL installed also. However I need my page to connect to the remote MSSQL server and I have come to my wits end. It will connect to the MYSQL server on the local host fine but I cannot connect to the MSSQL Server to save my life.

my connection string example is as follows.

<?php
$host = "myserver/myinstance";
$uid = "username";
$pwd = "password";
$db = "db name";



//$conn = mssql_connect($host, $uid, $pwd) or die('Could not connect')
	//or die("Couldn't connect to SQL Server on $host");

//$selected = mssql_select_db($db, $conn)
$dbhandle = mssql_connect($host, $uid, $pwd)
    or die("Couldn't connect to SQL Server on $host. Error: " . mssql_get_last_message());

echo "MSSQL Connection successful";

?>

The problem is that the code only produces this out put:
Couldn't connect to SQL Server on myserver/myinstance. Error:

I have been all over the internet and researched the issue till I was cross eyed, can anyone please help me solve my issue?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros