src/Util/PDOX.php
function columnType($fieldname, $source)
    {
        $column = self::describeColumn($fieldname, $source);
        if ( ! $column ) throw new \Exception("Could not find $fieldname");
        $type = U::get($column, "Type");
        if ( ! $type ) return null;
        if ( strpos($type, '(') === false ) return $type;
        $matches = array();
        preg_match('/([a-z]+)\([0-9]+\)/', $type, $matches);
        if ( count($matches) == 2 ) return $matches[1];
        return null;
    }
function columnType($fieldname, $source)
    {
        $column = self::describeColumn($fieldname, $source);
        if ( ! $column ) throw new \Exception("Could not find $fieldname");
        $type = U::get($column, "Type");
        if ( ! $type ) return null;
        if ( strpos($type, '(') === false ) return $type;
        $matches = array();
        preg_match('/([a-z]+)\([0-9]+\)/', $type, $matches);
        if ( count($matches) == 2 ) return $matches[1];
        return null;
    }
function columnType ( $ fieldname , $ source ) { $ column = self :: describeColumn ( $ fieldname , $ source ) ; if ( ! $ column ) throw new \ Exception ( "Could not find $fieldname" ) ; $ type = U :: get ( $ column , "Type" ) ; if ( ! $ type ) return null ; if ( strpos ( $ type , '(' ) === false ) return $ type ; $ matches = array ( ) ; preg_match ( '/([a-z]+)\([0-9]+\)/' , $ type , $ matches ) ; if ( count ( $ matches ) == 2 ) return $ matches [ 1 ] ; return null ; }
Get the column type

@param $fieldname The name of the column
@param $source Either an array of the column metadata or the name of the table

@return mixed Returns a string if the columns exists and null if the column does not exist.
Get the column type