useDbConfig); $tableName = $db->fullTableName($this, false); //Get the values for the specified column (database and version specific, needs testing) $result = $this->query("SHOW COLUMNS FROM {$tableName} LIKE '{$columnName}'"); //figure out where in the result our Types are (this varies between mysql versions) $types = null; if ( isset( $result[0]['COLUMNS']['Type'] ) ) { //MySQL 5 $types = $result[0]['COLUMNS']['Type']; $default = $result[0]['COLUMNS']['Default']; } elseif ( isset( $result[0][0]['Type'] ) ) { //MySQL 4 $types = $result[0][0]['Type']; $default = $result[0][0]['Default']; } else { //types return not accounted for return array(); } //Get the values return array_flip(array_merge(array(''), // MySQL sets 0 to be the empty string explode("','", preg_replace("/(enum)\('(.+?)'\)/","\\2", $types)) )); } //end getEnumValues }