The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.
PDO uses class constants since PHP 5.1. Prior releases use global constants in the form PDO_PARAM_BOOL.
Note: The magic __set() method is called if the property doesn't exist in the requested class
Example #1 using PDO::ATTR_DRIVER_NAME
<?php
if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
echo "Running on mysql; doing something mysql specific here\n";
}
?>