This functionality has me stumped; any help would be appreciated.
I need to show multiple selects on a page and then process the results on a target page. I don't know in advance how may selects there are since they are generated as part of a mySQL query. My problem is that I can't figure out what to name the selects to retrieve them in the target page. I've flagged the code with:
// WHAT DO I NAME THE SELECT HERE
Each select can only have one item selected, so I have't used the multiple option. I can't see "$sel_opt[]" in my target page. Thanks in advance.
Joe Sottnik
print "<form method='post' action='regrecord.php'>";
$query_cat = sqlGetCategory($key);
$result_cat = mysql_query($query_cat);
mysql_error();
$rows_cat = mysql_num_rows($result_cat);
for($i = 0; $i < $rows_cat; $i++) {
$data_cat = mysql_fetch_array($result_cat);
$query_type = sqlGetDanceTypeList($key, $data_cat[CategoryID]);
$result_type = mysql_query($query_type);
mysql_error();
$rows_type = mysql_num_rows($result_type);
print "<table>";
$prt_cat = true;
for($j = 0; $j < $rows_type; $j++) {
$data_type = mysql_fetch_array($result_type);
$query_dance = sqlQualDanceSetInType($key, $sess_champ, $sess_age, $data_type[DanceTypeID]);
$result_dance = mysql_query($query_dance);
mysql_error();
$rows_dance = mysql_num_rows($result_dance);
if($rows_dance > 0 && $prt_cat) {
print "<tr><td><h3>$data_cat[CategoryName]</h3></td><td></td>"; // print category name once
$prt_cat = false;
}
if($rows_dance > 0) {
print "<tr><td>$data_type[DanceNameLong]</td>";
print "<td><select name='sel_opt[]' size='1'>"; // WHAT DO I NAME THE SELECT HERE
print "<option value='0'>None";
for($k = 0; $k < $rows_dance; $k++) {
$data_dance = mysql_fetch_array($result_dance);
print "<option value='$data_dance[DanceSet]'>$data_dance[LevelName],
$data_dance[AgeGroupNameShort], ($data_dance[DanceSet])";
}
print "</select></td></tr>";
}
}
print "</table>";
}
print "<input type=image src='button.php?text=Submit' border=0>";
print "<input type=hidden name=festival value='$key'>";
print "</form>";