$enum_field = mysql_field_name($field_list, $i);
$select_command = mysql_query("SELECT $enum_field FROM $selected_table", $conn) or die (mysql_error());
$fetch_enum_array = mysql_fetch_row($select_command);
$enumarray = explode("','",preg_replace("/(enum|set)\('(.+?)'\)/","\\2",$fetch_enum_array));
This command should eledgedly return the enum values in an array in $enumarray. I need to break appart this array so I can put the different values into section with radiobuttons in a from.
I've tried doing a foreach command:
foreach ($enumarray as $enumvalue)
{
$render_insert .= "<input name=".mysql_field_name($field_list, $i)." type=\"radio\" value=\"$enumvalue\"> $enumvalue";
}
Which I thought would return one radiobutton for each value. However this returns only as one radiobutton saying Array. I obviously have not broken this array down correctly, so what is the correct way of doing that? Or does it return as Array when the array is empty, so I must have done something wrong earlier?
Appreciate any info on thisone, thanks 🙂