Created
November 18, 2011 01:27
-
-
Save henriquemoody/1375253 to your computer and use it in GitHub Desktop.
Test of PDO attributes
This file contains 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 | |
$pdo = new PDO("sqlite:/tmp/pdo.db"); | |
$attributes = array( | |
"AUTOCOMMIT", | |
"ERRMODE", | |
"CASE", | |
"CLIENT_VERSION", | |
"CONNECTION_STATUS", | |
"ORACLE_NULLS", | |
"DRIVER_NAME", | |
"PERSISTENT", | |
"PREFETCH", | |
"SERVER_INFO", | |
"SERVER_VERSION", | |
"TIMEOUT", | |
); | |
foreach ($attributes as $attribute) { | |
$constant = "PDO::ATTR_{$attribute}"; | |
echo $constant . ': ' . @$pdo->getAttribute(constant($constant)) . PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment