Page 1 of 1

Retrieve team from database then display TeamVsOpponent

Posted: Thu May 16, 2013 3:44 am
by NewbieET
Hey guys,

Im working on a sports club website.
I have in place already fixtures and teams for a particular club.

Now id like to be able to select players to play in each fixture. I have created a teamselection.php page which I have created a dynamic drop down box to list all the fixtures that are linked to the club which the user is logged into.

From here, once the user has selected the fixture, I want to create a list of the players currently selected as playing in that game.
For this I have created a new table called team_selection which will be used to store the players that are playing in each fixture.

Here is my code so far:

Code: Select all

<table width="60%" align="center" cellpadding="0" cellspacing="0" border="0" class="game">
<tr>
<th colspan="2">
Team Selection
</th>
</tr>
<tr>
<td width="63%">
<b>
Select Fixture You Wish To View Team Selection For:
</b>
</td>
<td align="center">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<select name="fixturedrp"><option value='' selected disabled>Select Fixture</option>
<?php 
	$sql = "SELECT * FROM fixtures WHERE club_id = '$id'";
  	$result = mysql_query($sql);
	while($row = mysql_fetch_array($result)){
		$fixture_id = $row["fixture_id"];
		$team = $row["team"];
		$opponents = $row["opponents"];
		$fixture = "$team Vs $opponents";
	?>
	<option value="<?php echo $fixture_id ?>"><?php echo $fixture ?></option>
	<?php } ?>
</select>
</td>
</tr>
<tr>
<td width="63%">
</td>
<td align="center">
<input name="submit" type="submit" value="Select Fixture" />
</form
</td>
</tr>
</table>
How would I go about the adding players to the fixture?

Cheers

Re: Retrieve team from database then display TeamVsOpponent

Posted: Thu May 16, 2013 12:30 pm
by requinix
Depends how you want people to do that. Have them look at a fixture and add players? Look at a player and add them to a fixture? Dedicated page where you search for a player and fixture and add the relationship?