How I can process a dynamic form. Number of options will vary by the number of options from the database. Based on yes/no value will be updated in the database is user want to test that parameter. Here is my code
<form action="?userid=<?php echo $userid;?>&tankid=<?php echo $tankid;?>&action=update" method="POST">
<table width="100%">
<tr>
<th >Parameter name:</th>
<th >Do you want to test it?</th>
</tr>
<?php
while ($row = $records_param_info->fetch(PDO::FETCH_ASSOC)){
$checked_yes = "";
$checked_no = "";
echo "<tr>";
echo "<td>";
echo $row['paramname'];
echo "</td><td>";
if ($row['active'] == 1){
$checked_yes = "checked";
$checked_no = "";
} else {
$checked_yes = "";
$checked_no = "checked";
}
echo '<label>Yes</label><input type="radio" name='.$row['parameterid'].' '.$checked_yes.' value="1">';
echo '<label>No</label><input type="radio" name='.$row['parameterid'].' '.$checked_no.' value="0">';
echo "<td></tr>";
}
?>
</table>
<br>
<center><input type="submit" name="Update" value ="Update"></center>
</form>
My question will be how to retrieve the data and processes it to the databse since the "name" will be always different and the number will be different.