Hi,
I want to make a <select> menu which lists one column of my mySQL table. The variable $field is the field I want to show in the <select> field. At the beginning of the script I read out my database and create all the arrays for the tablefields (e.g. $id_array(), $text_array() etc.).
So in the <select> list I have to define the field I want to show ($field). And I have to put together the name of the array dynamically. If I set $field as "text", then I want to create "$text_array[$i]".
Anyway, it's just not working. It just shows me the array name I am creating inside the <select> field, but not the value of this array element. Do I have to user eval() to get the value of this element?
for ($i=(count($id_array)-1); $i>=0; $i--) {
$dynamic_show = "\$" . $field . "_array[\$i]";
echo " <option value=\"" . $i . "\">" . $dynamic_show . "</option>\n";
}
Thanks for your help!
Bye,
Stefan