I am using the PDO Database Abstraction library to make sure my code is portable. However, I now find that I need column information so I turned to the PDOStatement->getColu
I thought that I could share what I have so far. Since native_type and pdo_type return such drastically different values - I am using the "len" to try to test for strings vs text since everything less than 255 is a var char, int, or boolean. Also, pdo_type only has 5 possible values.
//PDO data types
$types = array(
    PDO::PARAM_BOOL => 'bool',
    PDO::PARAM_NULL => 'null',
    PDO::PARAM_INT  => 'int',
    PDO::PARAM_STR  => 'string',
    PDO::PARAM_LOB  => 'blob',
    PDO::PARAM_STMT => 'statement'  //Not used right now
);
//Get meta
$column = $result->getColumnMeta(1);
//If the column lenght isn't set - default to ZERO
$column['len'] = isset($column['len']) ? $column['len'] : 0;
//HACK: If it is longer than 255 chars then it is a text area
if($column['len'] > 255) {
    $column['type'] = 'text';
} else {
    $column['type'] = $types[$column['pdo_type']];
}