Just thinking aloud here...
Would it be desirable to have two fields for each team in a form (goals
For and
Against) which would be submitted after every weeks action? I’m sure it wouldn’t be too hard to implement a system which takes those figures and adds them to their respective table entries in a database. Then the league table itself could be formed with some code which would look at all those results and calculate the wins and points for each team.
Sample database table structure:
Table: (teamname)
[table]
[tr][td]GameID [/td][td]For [/td][td]Against [/td][/tr]
[tr][td]1[/td][td]3[/td][td]1[/td][/tr]
[tr][td]2[/td][td]1[/td][td]2[/td][/tr]
[/table]
Or would that be over-complicating things? As it’s supposed to be a cheap website, probably.
So... keeping
just the up-to-date league table data in the database would do the job.
Sample database table structure:
Table: (leaguetable)
[table]
[tr][td]TeamName [/td][td]For [/td][td]Against [/td][td]Points [/td][/tr]
[tr][td]Arsenal[/td][td]7[/td][td]1[/td][td]6[/td][/tr]
[tr][td]Chelsea[/td][td]4[/td][td]2[/td][td]6[/td][/tr]
[/table]
A simple form could be prefilled with this data, ready for editing each week (maybe with the use of up and down buttons for each value?). When it’s submitted the new values simply overwrite the old ones.
This is pretty easy to do with
basic PHP database functions, but I know the
MODx API can do stuff with databases as well.
(Waits for more posts by people who know what they’re on about.)