title: How to get database name in PDO?
body: <pre><code>$dsn = 'mysql:dbname=testdb;host=127.0.0.1';
  $user = 'dbuser';
  $password = 'dbpass';
  
  try {
      $dbh = new PDO($dsn, $user, $password);
  } catch (PDOException $e) {
      echo 'Connection failed: ' . $e-&gt;getMessage();
  }
  </code></pre>
  
  <p>Is there a function or constant within PDO that stores the database name (the <code>testdb</code> value) ? I did a var_dump on $dbh and cant find anything...</p>