I'm generating a form with inputs like:
<input type="text" placeholder="# of patients" name="txt[1]" class=" form-control " />
<input type="text" placeholder="# of patients" name="txt[2]" class=" form-control " />
<input type="text" placeholder="# of patients" name="txt[3]" class=" form-control " />
<input type="text" placeholder="# of patients" name="txt[4]" class=" form-control " />
Now I want to get the values written in these fields using PHP. I'm using:
for($i = $maxi->max_id; $i<=$mani->min_id ; $i++) {
$Query = "UPDATE general table set number_of_patient='".$_REQUEST['txt[$i]']."'" ;
mysql_query($Query);
}
But it does not work and says "Undefined index". Kindly solve me for this. Your help would be appreciated.