Any ideas?????
Moderator: General Moderators
Any ideas?????
Hi, I am doing a project and was woundering if anyone knows how best to do this as I haven't a clue......
I am making a website where by sports players can book certain games off if they are not available to play. Then this information along with another table i have created, that has player information within it will email the coach a possible side?
Does anyone know the best way to go about this cos i need help???
I am making a website where by sports players can book certain games off if they are not available to play. Then this information along with another table i have created, that has player information within it will email the coach a possible side?
Does anyone know the best way to go about this cos i need help???
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Any ideas?????
So you want a player to be able to browse games and be able to book off certain ones?
Next, you want this info to be sent to a coach?
Correct?
Next, you want this info to be sent to a coach?
Correct?
Re: Any ideas?????
Yep thats correct, have you any ideas????
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Any ideas?????
Yeh sure,
What tables do you currently have?
What tables do you currently have?
Re: Any ideas?????
I currently have a table filled out with all the fixtures (dates, home or away, home team, away team) and i also have a table with the players contact details.
Does this help????
Does this help????
Re: Any ideas?????
I think Ace meant what database tables you've got so far. What data do you think you'll need to store for this application?
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Any ideas?????
yeh i meant what db tables do you have 
Re: Any ideas?????
Well i currently have this info for bringing up my fixtures table. Within my player table i have (position number, first name, last name, house number, house name, street, town, postcode, contact number, other contact number, email address).
Is this th info you looking for im new to php??? Im thinking im goin to have to create another table that stores the dataon the game they cannot play wont I???
<?php
$database = "localhost"; //login to the server
$username = "Dave"; //username login
$password = "*****"; //password login
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("<br><br>Unable to connect to Lincoln Database");
echo "<br><br>Connected to Lincoln Database<br><br>";
//select a database to work with
$selected = mysql_select_db("lincolnrugby",$dbhandle)
or die("Could not select lincoln rugby");
$result = mysql_query("SELECT * FROM 1stfixtures"); //execute the SQL query and return records
?>
<table>
<tr>
<td>Date</td>
<td>Home/Away Game</td>
<td>Home Team</td>
<td>Away Team</td>
</tr>
<?php
// Loop through all the rows
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
// Display the information
echo " <tr>\n";
echo " <td>".$row['Date']."</td>\n";
echo " <td>".$row['HomeAwayGame']."</td>\n";
echo " <td>".$row['HomeTeam']."</td>\n";
echo " <td>".$row['AwayTeam']."</td>\n";
echo " </tr>\n";
}
//close off the table
echo "</table>\n";
//close the connection
mysql_close($dbhandle);
?>
Is this th info you looking for im new to php??? Im thinking im goin to have to create another table that stores the dataon the game they cannot play wont I???
<?php
$database = "localhost"; //login to the server
$username = "Dave"; //username login
$password = "*****"; //password login
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("<br><br>Unable to connect to Lincoln Database");
echo "<br><br>Connected to Lincoln Database<br><br>";
//select a database to work with
$selected = mysql_select_db("lincolnrugby",$dbhandle)
or die("Could not select lincoln rugby");
$result = mysql_query("SELECT * FROM 1stfixtures"); //execute the SQL query and return records
?>
<table>
<tr>
<td>Date</td>
<td>Home/Away Game</td>
<td>Home Team</td>
<td>Away Team</td>
</tr>
<?php
// Loop through all the rows
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
// Display the information
echo " <tr>\n";
echo " <td>".$row['Date']."</td>\n";
echo " <td>".$row['HomeAwayGame']."</td>\n";
echo " <td>".$row['HomeTeam']."</td>\n";
echo " <td>".$row['AwayTeam']."</td>\n";
echo " </tr>\n";
}
//close off the table
echo "</table>\n";
//close the connection
mysql_close($dbhandle);
?>
Re: Any ideas?????
There the only tables I have at the moment:
1stfixtures
1stsquad
1stfixtures
1stsquad
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Any ideas?????
Ok,
You'll need to create the following tables:
1. tblTeam - this will store info about each team (id, name etc...)
2. tblPlayer - this will store info about each player
3. tblCoach - this will store info about the coaches
4. tblTeamPlayer - this will link each player to the team they play for
5. tblTeamCoach - this will link each coach to the team they coach
6. tblFixtures - like you have (the home tam and away team will be the id's of the teams from tblTeam
7. tblPlayerFixtures - this will link each player with each game they want to play or not
Does this make sense?
You'll need to create the following tables:
1. tblTeam - this will store info about each team (id, name etc...)
2. tblPlayer - this will store info about each player
3. tblCoach - this will store info about the coaches
4. tblTeamPlayer - this will link each player to the team they play for
5. tblTeamCoach - this will link each coach to the team they coach
6. tblFixtures - like you have (the home tam and away team will be the id's of the teams from tblTeam
7. tblPlayerFixtures - this will link each player with each game they want to play or not
Does this make sense?
Re: Any ideas?????
Ok i think I do. and from there i will have to then write my code right???
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Any ideas?????
Yeh,
I can help if u like. In order to display results from multiple table you will have to use JOINS.
Doing it this way is the most efficient way - its called normalisation.
Do you understand how the tables will be linked?
I can help if u like. In order to display results from multiple table you will have to use JOINS.
Doing it this way is the most efficient way - its called normalisation.
Do you understand how the tables will be linked?
Re: Any ideas?????
If dont mind that would be awesome. Took on a project a little to hard me thinks.
I understand normalisation but unsure how to do it in SQL. Im using wamp server if u have heard of that to which im running everything of.
I understand normalisation but unsure how to do it in SQL. Im using wamp server if u have heard of that to which im running everything of.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Any ideas?????
ok, ill be back online a bit later.
Just finishing work.
I will post back soon.
Just finishing work.
I will post back soon.
Re: Any ideas?????
Ok thanks ill try and get on and create these tables. ill be onlineso i look forward to hearing from you.
cheers
cheers