Mysql on version "5.6.29" not support "PDO::ATTR_PREFETCH" and "PDO::ATTR_TIMEOUT"
(PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
PDO::getAttribute — Retrieve a database connection attribute
This function returns the value of a database connection attribute. To retrieve PDOStatement attributes, refer to PDOStatement::getAttribute().
Note that some database/driver combinations may not support all of the database connection attributes.
attribute
One of the PDO::ATTR_* constants. The constants that apply to database connections are as follows:
A successful call returns the value of the requested PDO attribute. An unsuccessful call returns null.
Example #1 Retrieving database connection attributes
<?php
$conn = new PDO('odbc:sample', 'db2inst1', 'ibmdb2');
$attributes = array(
"AUTOCOMMIT", "ERRMODE", "CASE", "CLIENT_VERSION", "CONNECTION_STATUS",
"ORACLE_NULLS", "PERSISTENT", "PREFETCH", "SERVER_INFO", "SERVER_VERSION",
"TIMEOUT"
);
foreach ($attributes as $val) {
echo "PDO::ATTR_$val: ";
echo $conn->getAttribute(constant("PDO::ATTR_$val")) . "\n";
}
?>
Mysql on version "5.6.29" not support "PDO::ATTR_PREFETCH" and "PDO::ATTR_TIMEOUT"
Oracle does not have the following attributes:
PDO::ATTR_CONNECTION_STATUS: SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute
PDO::ATTR_PREFETCH: SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute
PDO::ATTR_TIMEOUT: SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute
The rest work fine.
As of 30-Jan-2016, MariaDB on version "5.5.5-10.1.9-MariaDB" apparently does not support: "PREFETCH" nor "TIMEOUT".
The Oracle driver seems to not support PDO::getAttribute():
ociPHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IM001]: Driver does not support this function: driver does not support getting attributes' in ...