Im getting an error when i try to connect to my database with php, this is my code: $serverName = "sql2k510.discountasp.net"; $uid = "SQL2005_******_******_user"; $pwd = "******"; $databaseName = "SQL2005_******_******"; $connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd, "Database"=>$databaseName); /* Connect using SQL Server Authentication. */ $conn = sqlsrv_connect( $serverName, $connectionInfo); /* Check the connection to be done */ if ( $conn ) { echo "Connection established.\n"; } else { echo "Connection could not be established.\n"; die( print_r( sqlsrv_errors(), true)); } What is wrong with it?
Actually the whole error is this: Connection could not be established. Array ( [0] => Array ( [0] => IM003 [SQLSTATE] => IM003 [1] => 160 Code: => 160 [2] => Specified driver could not be loaded due to system error 14001 (SQL Server Native Client 10.0). [message] => Specified driver could not be loaded due to system error 14001 (SQL Server Native Client 10.0). ) )
It looks like there was a configuration issue on the server that was causing the problem which we've fixed, sorry about that. Can you try your script again to see if you can at least establish a connection and then execute a query?