I have a form which has 20 selects. These are all the players in a tournament who could finish in the top 20 places, 1st - 20th. The drop down is a list of names from my players database. Using php I read the mysql table for a list of "players" and create a drop down with the full list. The list choices are the same for all 20 selects. The list of 20 is preceded by the tournament identifiers, date, tournament number which have labels. Using GET I see the string which is created:
tdate=09%2F11%2F2009&tnumber=on&Select1=Mickey+Mouse&Select1=Daisy+Duck&Select1=Daisy+Duck&Select1=Pluto&Select1=Daisy+Duck&Select1=Mickey+Mouse&Select1=Daisy+Duck&Select1=Daisy+Duck&Select1=Mickey+Mouse&Select1=Daisy+Duck&Select1=Pluto&Select1=Daisy+Duck&Select1=Pluto&Select1=Daisy+Duck&Select1=Mickey+Mouse&Select1=Mickey+Mouse&Select1=Daisy+Duck&Select1=Pluto&Select1=Daisy+Duck&Select1=Pluto&Submit1=submit
I retrieve the tdate and tnumber with:
$tdate = $_REQUEST['tdate'];
$tnumber = $_REQUEST['tnumber'];
But I do not know how to retrieve the multiple Select1= values.
Since I have 20 different selects, is it possible to insert a different key along with the value?
This is the code which displays one of the selects (places 1st - 20th:
<div id="label">1st Place</div>
<div id="lookup"><?php get_player_selections($tavern_id, "first");?></div>
And this is the php function which creates and populates the select drop down.
function get_player_selections($tavern_id,$place){
global $connection;
$query= "SELECT * FROM players WHERE tavern_id='".$tavern_id."' ORDER BY name ASC";
$player_set= mysql_query($query);
confirm_query ($player_set);
$rows = mysql_num_rows($player_set);
$i=0;
echo "<select name='Select1'>";
while ($i < $rows) {
$data = mysql_fetch_array($player_set);
echo "<option>".$data['name']."</option>";
$i++;
}
echo "</select>";
}