The INFORMATION_SCHEMA database is part of the ANSI 2003 specification, so you can use it for any database provider that supports it (MySQL, Postgresql, SQLite, MSSQL 2k5 +).
function is_dbtype($table, $column, $type) {
$db = (...)::getInstance();
$sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS '.
'WHERE TABLE_NAME = :table AND COLUMN_NAME = :column';
$st = $db->prepare($sql);
$st->execute(array(':table' => $table, ':column' => $column));
return ($type == $st->fetchColumn());
}
COLUMN_TYPE DATA_TYPE, "varchar" "varchar (64)". , : IS_NULLABLE, NUMERIC_PRECISION, CHARACTER_SET_NAME ..
( , , is_* . , info_schema , () . , , , .)
MySQL-only alternate: , DESCRIBE [table]. , "bigint" "bigint (21) ", , .