I am trying to establish a connection to my company's MSSQL server with windows authentication , but it fails as it is trying to use my computer name as login instead of my login id. When logging in with the MS SQL Server Management the windows authentication works fine, but not with this PHP code:
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$serverName = "xxx";
$connectionInfo = array( "Database"=>"xxx");
/* Connect using Windows Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
//
?>
The printout I get is the following:
[Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'xxx\T2002197$'. ) )
T2002197 is my computer name, not my login id, so of course it fails. How can I solve this? I am using WAMP. Edited out some info, replaced with 'xxx'