Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Now connect to an Azure SQL database by setting Authentication to ActiveDirectoryPassword
- $azureServer = "vgissql";
- $azureDatabase = "dbo.pctProjectTracking";
- $azureUsername = "myuid";
- $azurePassword = "mypassword";
- $connectionInfo = "Database = $azureDatabase; Authentication = ActiveDirectoryPassword;";
- try
- {
- $conn = new PDO( "sqlsrv:server = $azureServer ; $connectionInfo", $azureUsername, $azurePassword );
- echo "Connected successfully with Authentication=ActiveDirectoryPassword.n";
- $conn = null;
- }
- catch( PDOException $e )
- {
- echo "Could not connect with Authentication=ActiveDirectoryPassword.n";
- print_r( $e->getMessage() );
- echo "n";
- }
- ?>
Add Comment
Please, Sign In to add comment