PHP function to return MySql Enumeration values as an Array
by Sowndarya[ Edit ] 2013-12-31 10:49:30
function getEnums($table,$field)
{
$sql = "SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '$table' AND COLUMN_NAME = '$field'";
$this->query($sql);
preg_match_all('/'(.[^']+)'/',$this->get('COLUMN_TYPE'),$matches);
return $matches[1];
}