I have a problem using the sqlsrv_connect function (in that it's failing!). I have been using mssql_connect on a server with an older verison of PHP where my connect string worked fine. But putting the information into the sqlsrv_connect doesn't let it connect.
Here's my code that I used on my old script:
$server = "serverIP,serverPort"; $user = "user"; $pass = "password"; $db = "db"; $conn = mssql_connect($server, $user, $pass) or die("Couldn't connect to SQL Server");
And that worked fine. I then use this on the new server:
$server = "serverIP,serverPort"; $user = "user"; $pass = "pass"; $db = "db"; $connInfo = array("Database"=>$db, "UID"=>$user, "PWD"=>$pass); $conn = sqlsrv_connect($server, $connInfo) or die("Couldn't connect to SQL Server");
And it comes up saying it couldn't connect. I'm not sure whether I need to change my server variable maybe? (Although the database is still on the same server, so not sure why that would be different) but everything I've read has said something about using serverName/InstanceName. I'm not sure what this is though.
Any help would be greatly appreciated.
Thanks in advance :)