Advertisement
LrdArc

Untitled

Jun 21st, 2016
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2. /* Connect to an ODBC database using driver invocation */
  3. $dsn = 'sqlsrv:Database=testdb;Server=127.0.0.1';
  4. $user = 'dbuser';
  5. $password = 'dbpass';
  6.  
  7. try {
  8. $dbh = new PDO($dsn, $user, $password);
  9. } catch (PDOException $e) {
  10. echo 'Connection failed: ' . $e->getMessage();
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement