getting id's from drop down lists

I have a database table that includes the names of football teams and another table for holding scheduling info. I have created 2 drop down lists with the team names, so that I can pick a home team and an away team and place those id’s in the scheduling table. I would like to do this from the same page, at the same time. (

My problem is when I submit the form, only 1 id is returned.

Here is the code I am using: (it’s already inside the ) What I’d like to do is use this code twice, once for the home team and once for the away team.

<?php include("opendatabase.php"); $querya="SELECT team_id,team_name FROM teams"; $resulta = mysql_query ($querya); echo ""; while($hometeam=mysql_fetch_array($resulta)){ echo "$hometeam[team_name]"; } echo ""; ?>

I understand that “team_name” will return the team_id, so how do I return the team_id of another team so I can insert them in the database together?

Thanks for you help!

i think this question is repeated… anyway the solution for this question is available at,10905.0/topicseen.html

Sponsor our Newsletter | Privacy Policy | Terms of Service