php pdo pobierz nazwę bazy danych
$pdo->query('select database()')->fetchColumn();
GutoTrosla
$pdo->query('select database()')->fetchColumn();