array getColumnMeta(int column);
This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.
Retrieves the metadata for a 0-indexed column in a result set as an associative array.
Not all PDO drivers support PDOStatement->getColumnMeta().
Returns an associative array containing the following values representing the metadata for a single column:
|The PHP native type used to represent the column value.|
|The SQL type used to represent the column value in the database. If the column in the result set is the result of a function, this value is not returned by PDOStatement->getColumnMeta().|
|Any flags set for this column.|
|The name of this column as returned by the database.|
|The name of this column's table as returned by the database.|
|The length of this column. Normally |
|The numeric precision of this column. Normally
|The type of this column as represented by the
FALSE if the requested column does not exist in the result set,
or if no result set exists.
The following example shows the results of retrieving the metadata for a single column generated by a function (COUNT) in a PDO_SQLITE driver.
$select = $DB->query('SELECT COUNT(*) FROM fruit');
$meta = $select->getColumnMeta(0);
The above example will output: