Hello,
I am trying to have a form generated by the DB and then give the user the ability to select yes or no on that form for each entry pulled out of the DB. See the following...
echo "<TR>
<TD WIDTH='33%' VALIGN='TOP'><span class='main'><INPUT TYPE='checkbox' NAME='allowed[]' VALUE='yes' $checked>Allow to<br> $caption?</TD>
<TD WIDTH='33%' VALIGN='TOP'><span class='main'><INPUT TYPE='checkbox' NAME='allowed[]' VALUE='no' $checked>Disallow to<br> $caption?</TD>
<TD WIDTH='33%' VALIGN='TOP'><span class='main'><b>$firm_orgtitle</b><br>$firm_address<br>$firm_city, $firm_state $firm_zip<br>$firm_id</TD>
</TR><INPUT TYPE='hidden' name='firm_id[]' value='$firm_id'>";
then....
foreach($firm_id as $firm_id => $firm_id_insert){
foreach($allowed as $allowed => $allowed_insert){
$sql11d = "INSERT into permissions set case_id='$case_id', firm_id='$firm_id_insert', allow='$allowed_insert'";
$sql_result11d = mysql_query($sql11d,$connection) or die("Invalid query: " . mysql_error());
header("Location:settings.php?tag=success11");
}
}
Well, this not workie. It is putting yes or no into the DB as a seperate row, but the firm_id is the first one from the original query in each new row. Can someone tell me the right way to do this? Thanks
Shawn