tony
tony

Reputation: 11

Connection to my MSSqlserver isn't working

<!DOCTYPE html>
<HTML lang="en-US">
<head>
</head>
<body>
<?php
    echo "HUH";

    $serverName = "serverName";
    echo "we got here 1";

    $connectionInfo = array( "Database"=>"dbName", "UID"=>"default", "PWD"=>"123456789",);      

    echo "we got here 2";

$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn )  
{  
     echo "Connection established.\n";  
}  
else  
{  
     echo "Connection could not be established.\n";  
     die( print_r( sqlsrv_errors(), true));  
}  

echo "we got here 3";

?>
</body>
</html>

Hello there, On my webpage it has echoed out up to "we got here 2" but i can never get any kind of output from anything after the $conn line. I've doubled checked all of server/username/and passwords but I still don't know why its not working. Am i missing anything crucial here?

Upvotes: 0

Views: 32

Answers (1)

tony
tony

Reputation: 11

Sorry for the question I just realized the problem was that the php website is hosted online by futurequest.com where as the mssqlserver I'm trying to connect to is on my local computer which was why it didn't work. I should be using the database provided on futurequest itself instead of my own personal on my machine it seems.

Upvotes: 1

Related Questions