Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Connect to an ODBC database using driver invocation */
- $dsn = 'sqlsrv:Database=testdb;Server=127.0.0.1';
- $user = 'dbuser';
- $password = 'dbpass';
- try {
- $dbh = new PDO($dsn, $user, $password);
- } catch (PDOException $e) {
- echo 'Connection failed: ' . $e->getMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement