function enum_select($table,$field) {
$result=mysql_query("SHOW COLUMNS FROM `$table` LIKE '$field'");
if(mysql_num_rows($result)>0){
$row=mysql_fetch_row($result);
$options=explode("','", preg_replace("/(enum|set)\('(.+?)'\)/","\\2", $row[1]));
$i=1;
foreach ($options as $value) {
@$option .= '
';
}
} else {
$options=array();
}
return $option;
}
AND HTML
<.select>
<.option>[Seleccione una]<./option>
<./select>