|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-24 08:32 UTC] kalle@php.net
-Package: PDO Core
+Package: PDO related
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ DSN string is currently parsed internally but isn't exposed via public API. It would be especially useful for database backup tools, migrations etc. where it's important to get database name, username etc. Test script: --------------- $connection = new PDO('mysql:host=localhost;dbname=test', $user, $password); // mysql echo $connection->getDriverName(); // localhost echo $connection->getParameter('host'); // test echo $connection->getParameter('dbname');