Skip to content

Instantly share code, notes, and snippets.

@henriquemoody
Created November 18, 2011 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henriquemoody/1375253 to your computer and use it in GitHub Desktop.
Save henriquemoody/1375253 to your computer and use it in GitHub Desktop.
Test of PDO attributes
<?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