HI there all,
I am creating form for inputing data onto MySQL, the form is dynamically generated depending on how many staff exist on the db so I dont know the id of the input text fields. I managed to work out something such as this:
for ($i= 0 ; $i <= $num_results-1 ; $i++){
$row = mysql_fetch_array($result);
echo '<TR><TD WIDTH="113" >'.htmlspecialchars(stripslashes($row['staff_no'])).'</TD>';
for ($b = 0 ; $b <= 6 ; $b++){
echo '<TD WIDTH=" 81.6 " ALIGN="CENTER"><INPUT TYPE="text" NAME="'.$row['staff_no'].$b.'" SIZE="3" MaxLENGTH="3" </TD>';
}
echo '</TR>';
}
when I do print_r($_POST) I get this:
[02E600] => [02E601] => [02E602] => [02E603] => [02E604] => [02E605] => [02E606] => [1To5K0] => [1To5K1] => [1To5K2] => [1To5K3] => [1To5K4] => [1To5K5] => [1To5K6] => [28kfk0] => [28kfk1] => [28kfk2] => [28kfk3] => [28kfk4] => [28kfk5] => [28kfk6] => )
I managed to create an unique ID for each field.
based on the staff_id plus the loop $b value
the problem I have now is how to retrieve this values. I know how many staff will be in the db and the and the added digits is allways from 0 to 6 but I cannot figure out how to do it
any help would be much appreciatted
any ideas?