I get the following error:
Connection could not be established. Array ( [0] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0
=> 0 [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) ) [/quote] When trying to connect to my MSSQL database with the following code: [code=php]$serverName = "(local)"; $connectionInfo = array("UID" => "User", "PWD" => "Password", "Database"=>"DB_NAME"); $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)); } //----------------------------------------------- // Perform operations with connection. //----------------------------------------------- /* Close the connection. */ sqlsrv_close( $conn);
Can someone help me figure this out? I can't connect for some reason.