我有一个适合您的preigniter版本。它还从值中去除引号。
function get_enum_values( $table, $field ){ $type = $this->db->query( "SHOW COLUMNS FROM {$table} WHERe Field = '{$field}'" )->row( 0 )->Type; preg_match("/^enum('(.*)')$/", $type, $matches); $enum = explode("','", $matches[1]); return $enum;}


