hi i was just wondering if some one could help me write a query?
table 1 is called 'dreamteam'
where i enter an id, name, team,price,points for each player,
Quote:
ID, NAME, TEAM, PRICE, POINTS
1, Lehmann, Arsenal, 4, 0
2, Taylor, Arsenal, 3.5, 0
4, Postma, Aston Villa, 1.5, 0
3, Enckelman, Aston Villa, 2.5, 0
5, Bennett, Birmingham, 2.5, 0
table 2 is called 'teams' where i enter the id's of the teams
TEAM_NAME, TEAM_ADMIN, PLAYER_1, PLAYER_2, PLAYER_3, PLAYER_4, PLAYER_5, PLAYER_6, PLAYER_7, PLAYER_8, PLAYER_9 , PLAYER_10, PLAYER_11,
the winners, 1, 29 ,123, 142, 175, 21,1 329, 396, 413, 546, 550, 564
what the idea of my website is to run a fanatcy football game similer to the newspapers in the uk for a few lads at work for a bit of fun. http://www.dreamteam.greater-peterborough.com/
what i would like to do is update the 'dreamteam' table points
every week and the totals off each fantacy team to be displayed on the main page.
what i would like you to help me with is, how do i write a query to help me do this.
ie: if a team has players
id, points
1, 3
2, 4
3, 7
6, -2
59, 12
4, 0
etc!
the total point i need to display is 24
how do i write the query.
a friend help me with the query on the bottom of my main page
Code:
$sql = "select team,sum(POINTS) from dreamteam group by TEAM";
this brings back the total points that each real team name ( arsenal - aston villa et🙂
please help
many thanks jason