Content deleted Content added
Line 37:
</syntaxhighlight>
In [[PHP]] using the [https://pear.php.net/package/DB/ PEAR::DB] package to open a connection without an external DSN (a "DSN-less connection", i.e., using a Connection String){{Clarify|How is this an example of DSN use|date=June 2013}}, the code might resemble the following:
<syntaxhighlight lang="php">
Line 44:
$dsn = "mysql://john:pass@localhost:3306/my_db";
$db = DB::connect($dsn);
</syntaxhighlight>
PHP with PDO
<syntaxhighlight lang="php">
$dsn = "mysql:host=localhost;dbname=example";
|