kemper Posted April 22, 2008 Share Posted April 22, 2008 I have a script that I only want to echo: team name (the team that is already assigned). It currently is a dropdown menu with a list teams with a specific division. <tr><td class='tbl1'>Away: <select name="loser"> <?php $query3="SELECT sportsdb_teams.teamid, sportsdb_teams.teamname, sportsdb_divs.divname FROM sportsdb_teams, sportsdb_divs WHERE sportsdb_teams.active=1 AND sportsdb_teams.teamdiv = sportsdb_divs.divid AND sportsdb_divs.conference = $confid ORDER BY divorder ASC, teamname ASC"; $result3=mysql_query($query3); while ($teams = mysql_fetch_array($result3, MYSQL_ASSOC)) { echo "<option value=\"{$teams['teamid']}\""; if ($teams['teamid'] == $score['loser']) { print " selected=\"selected\""; } print ">{$teams['teamname']}</option>\n"; } print "</select></td><td bgcolor='#FFFF00'>Score: <input type=\"text\" name=\"ra\" size=\"2\" maxlength=\"2\" value=\"{$score['ra']}\" /></td></tr>\n"; ?> Assistance is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/ Share on other sites More sharing options...
kemper Posted April 22, 2008 Author Share Posted April 22, 2008 No help I guess. Thanks anyways! Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523503 Share on other sites More sharing options...
Northern Flame Posted April 22, 2008 Share Posted April 22, 2008 do you only want to display one result or all of them but not in a drop down? Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523504 Share on other sites More sharing options...
kemper Posted April 22, 2008 Author Share Posted April 22, 2008 just the one. Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523507 Share on other sites More sharing options...
Northern Flame Posted April 22, 2008 Share Posted April 22, 2008 try: <tr><td class='tbl1'>Away: <?php $query3="SELECT sportsdb_teams.teamid, sportsdb_teams.teamname, sportsdb_divs.divname FROM sportsdb_teams, sportsdb_divs WHERE sportsdb_teams.active=1 AND sportsdb_teams.teamdiv = sportsdb_divs.divid AND sportsdb_divs.conference = $confid ORDER BY divorder ASC, teamname ASC"; $result3=mysql_query($query3); $teams = mysql_fetch_array($result3, MYSQL_ASSOC); print ">{$teams['teamname']}</option>\n"; print "</td><td bgcolor='#FFFF00'>Score: <input type=\"text\" name=\"ra\" size=\"2\" maxlength=\"2\" value=\"{$score['ra']}\" /></td></tr>\n"; ?> Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523510 Share on other sites More sharing options...
kemper Posted April 22, 2008 Author Share Posted April 22, 2008 It is echoing just one team for any game like: Game 1: Team 3 vs. Team 4 (echoing Team 1) Game 2: Team 8 vs. Team 5 (echoing Team 1) It is echoing one team, but the incorrect and same team name in each game. Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523516 Share on other sites More sharing options...
Northern Flame Posted April 22, 2008 Share Posted April 22, 2008 so what do you want it to echo? Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523520 Share on other sites More sharing options...
kemper Posted April 22, 2008 Author Share Posted April 22, 2008 The original was a dropdown menu, but the Select was a predetermined teamid. I want to eliminate the risk of changing the team when entering the scores. The Select team is what should be echoing. Thanks! Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523526 Share on other sites More sharing options...
kemper Posted April 22, 2008 Author Share Posted April 22, 2008 The modified code echos the first teamname with in that specific division as defined by ORDER BY divorder ASC, teamname ASC I need it to echo the team that is assigned to that field. Assistance is appreciated. Link to comment https://forums.phpfreaks.com/topic/102240-remove-dropdown/#findComment-523908 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.