Jump to content

remove dropdown


kemper

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.