alkaholik 0 Newbie Poster

This code is what I use to populate a dropdown menu to pick an NFL Team for the super bowl. Once they select a team I want a second menu that will draw from the same table but only grab from the opposite conference of the first team.

The table teamstandings has all of the team's names, and it also has conference and division fields. I used 1 for AFC and 2 for NFC, and 1 for EAST, 2 for WEST, 3 for NORTH, and 4 for SOUTH.

I wondered if there was a way to use the table for this too.

Thanks!

<td class="TBLROW">
        <font class="TBLROW">
        Super Bowl Pick: 
            <select name="SBPICK">
<?

        if ($User->favteam == "") {
            echo "<option selected value=''> </option>\n";
        }
        
    $teamquery = "SELECT * FROM plteamstandings ORDER BY name";
    $teamresult = mysql_query($teamquery);

    while ($teamline = mysql_fetch_array($teamresult, MYSQL_ASSOC)) {
    
        if ($User->sbpick == $teamline['name']) {

            echo "<option selected value='".$teamline['name']."'>".$teamline['name']."</option>\n";

        } else {

            echo "<option value='".$teamline['name']."'>".$teamline['name']."</option>\n";
        }
    }
    
    
?>
        </select>
        </font>
      </td>