0

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:

http://www.nfl.com/standings/

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?

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by ses5909
0

Where and when exactly are you updating the matchdata? Why not update the team standings then? then our page need only pull from the table.

Yes, anything is possible though. I'm assuming you have other tables in your db? If so, you could also get the stats without having the teamstanding table if you use your matchdata table in conjunction with a teams and division table.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.