Once a team is selected, how do I return just the team_id?
----drop down list code----
Code: Select all
<?php
include("opendatabase.php");
$querya="SELECT team_id,team_name FROM teams";
$resulta = mysql_query ($querya);
echo "<select team_name=option value=''></option>";
while($hometeam=mysql_fetch_array($resulta))
{
echo "<option value=$hometeam[team_id]>$hometeam[team_name]</option>";
}
echo "</select>";
?>
I want to create a variable ($hometeam) that is just the team_id number so I can pass it to my insert.php file.
Thanks for helping a newbie!!