I have the following form
<FORM NAME="form1" METHOD="POST">
<?php do { ?>
<input name="approve[]" type="checkbox" id="approve[]" value="<?php echo
$row_rs['ID']; ?>">
<select name="select">
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</select>
<?php } while ($row_rs = mysql_fetch_assoc($rs)); ?>
</FORM>
I want to acheive a loop that inserts a record into a database that enters
the id and the value they have selected (if the approve input box was
ticked)
so far I have this:
<?
foreach($approve as $aID) {
$insertSQL = "INSERT INTO TABLE('refID','optionSelected') VALUES
('$aID','')";
}
?>
How do I enter the select value within this loop?
I assumed that it would be just
$insertSQL = "INSERT INTO TABLE('refID','optionSelected') VALUES
('$aID','$select')";
But how does the form know what select item is associated with what ID
Hope this makes sense
any help would be grateful
Craig