Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $serverName = "serverName";
- $dbusername = "dbusername";
- $dbpassword = "dbpassword";
- $dbname = 'dbname';
- $connectionInfo = array( "Database"=>$dbname, "UID"=>$dbusername, "PWD"=>$dbpassword);
- $link = sqlsrv_connect( $serverName, $connectionInfo);
- if( $link !== false ) {
- echo "Connection established.".PHP_EOL;}
- else{
- die( print_r( sqlsrv_errors(), true));
- }
- Array(
- [0] => Array
- (
- [0] => IMSSP
- [SQLSTATE] => IMSSP
- [1] => -49
- [code] => -49
- [2] => This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server. Access the following URL to download the ODBC Driver 11 or 13 for SQL Server for x64: http://go.microsoft.com/fwlink/?LinkId=163712
- [message] => This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server. Access the following URL to download the ODBC Driver 11 or 13 for SQL Server for x64: http://go.microsoft.com/fwlink/?LinkId=163712
- )
- [1] => Array
- (
- [0] => IM002
- [SQLSTATE] => IM002
- [1] => 0
- [code] => 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
- )
- )
Add Comment
Please, Sign In to add comment