I'm not sure if I should post this in PHP or MYSQL, oh well.
I have a nfl predictions site, and I want to dynamically update my stadings from another table in the database.
I have one table (called: matchData) with all of the matches with the following fields:
lid
matchid
matchdate
hometeam
awayteam
homescore
awayscore
week
the i have another (called: teamstandings) with the following fields:
lid
name
win
loss
pf
pa
div (i set 1 for AFC and 2 for NFC)
conf (i set 1 for EAST and 2 for WEST and 3 for North and 4 for South)
What I want is to have a standings page that does the following
first it looks at all the MatchData info and updates TeamStandings with the Wins, Losses, Points For, and Points Against.
Then I want my standings page to take from the table TeamStandings table and print out the teams like so:
Conference:
Division:
team ( win, loss, pf, pa)
next team...
next team...
next team...
next Division:
team ( win, loss, pf, pa)
next team...
next team...
next team...
next Division:
team ( win, loss, pf, pa)
next team...
next team...
next team...
next Division:
team ( win, loss, pf, pa)
next team...
next team...
next team...
next Conference:
next Division:
team ( win, loss, pf, pa)
next team...
next team...
next team...
next Division:
team ( win, loss, pf, pa)
next team...
next team...
next team...
and so on...
Is this possible?