Awesome, actually. I had the whole program fixed the night before I had to present it.
I basically used a counter variable to generate individual variables for each merit badge selection, per scout (i.e. merit1_1, merit2_1, merit3_1 ... merit1_4, merit2_4, merit3_4, etc., etc.) As I stated before, in the form, I also listed the pre-entered scout names. When the form was submitted, I called another mySQL query, identical to the one I originally used in the form (so basically, as the names are inserted, they will be put in the same order, and thus, with the same merit badge selections.) Using a while loop, I posted the merit badge selection values into variables and inserted them into a table. It's actually pretty simple. I'll post a code sample below:
$scoutcount = 0;
$rowcount = 0;
$query = "SELECT scout_id, scout_first, scout_last, troop_num FROM roster WHERE troop_num='" . $_SESSION['troop_num'] . "' ORDER BY scout_last ASC";
$mysql_result = mysql_query($query);
while($row = mysql_fetch_row($mysql_result)) {
$scoutcount = $scoutcount + 1;
$scout_id = $row[0];
$scout_first = $row[1];
$scout_last = $row[2];
$troopnum = $row[3];
$mnine = escape_data($_POST['meritnine' . $scoutcount]);
$mten = escape_data($_POST['meritten' . $scoutcount]);
$meleven = escape_data($_POST['meriteleven' . $scoutcount]);
$mtwo = escape_data($_POST['merittwo' . $scoutcount]);
$mthree = escape_data($_POST['meritthree' . $scoutcount]);
$malt = escape_data($_POST['meritalt' . $scoutcount]);
$query = "INSERT INTO merit_reg (scout_id, scout_first, scout_last, troop_num, merit9, merit10, merit11, merit2, merit3, meritalt, regdate) VALUES ('$scout_id', '$scout_first', '$scout_last', '$troopnum', '$mnine', '$mten', '$meleven', '$mtwo', '$mthree', '$malt', NOW() )";
$result = mysql_query($query);
if (mysql_affected_rows() == 1) {
$rowcount = $rowcount +1;
Like I said, pretty simple. If you'd like more info on how I did it, you can just drop me an email. Thanks again for all your help.