Guest User

Untitled

a guest
Aug 2nd, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. How to get database name in PDO?
  2. $dsn = 'mysql:dbname=testdb;host=127.0.0.1';
  3. $user = 'dbuser';
  4. $password = 'dbpass';
  5.  
  6. try {
  7. $dbh = new PDO($dsn, $user, $password);
  8. } catch (PDOException $e) {
  9. echo 'Connection failed: ' . $e->getMessage();
  10. }
Add Comment
Please, Sign In to add comment