Created
June 27, 2010 08:41
-
-
Save cirpo/454761 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
var_dump(Pdo::getAvailableDrivers()); | |
foreach (Pdo::getAvailableDrivers() as $driver => $d) { | |
try { | |
echo $dsn = $d . ':dbname=testdb;host=127.0.0.1'; | |
echo PHP_EOL; | |
$dbh = new PDO($dsn, 'dbuser', 'dbpass'); | |
} catch(PDOException $e) { | |
echo 'Connection failed: ' . $e->getMessage(); | |
} | |
} | |
try { | |
echo PHP_EOL; | |
echo $dsn = 'cirpo:dbname=testdb;host=127.0.0.1'; | |
$user = 'dbuser'; | |
$password = 'dbpass'; | |
$dbh = new PDO($dsn, $user, $password); | |
} catch(PDOException $e) { | |
echo 'Connection failed: ' . $e->getMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment