View Full Version : Automatic League Table

12-06-2010, 07:37 PM
I currently run a Fifa 11 Gaming League and I have an issue with updating my league table pages automatically when a manager submits a result. I want it to only update the table if both managers report the score and the score is the same on both sides, this seems very confusing and I am struggling to think of a MySQL table structure I could use for this. I am quite proficient in PHP but this seems confusing. Any guidance would be appreciated, I am not sure whether JavaScript could achieve this, if you know please tell me :)

Thank you

12-06-2010, 09:26 PM
This does sound like a design issue you need to resolve. Some possible solutions:

1) use a column "status_code" to keep tabs on each game submission. It could be as simple as this kind of table:

0 means neither manager has submitted
1 means only one manager has submitted
2 means two managers have submitted and the scores match
-1 means two managers have submitted and the scores do not match

2) Store manager submissions in a separate table, relating to the submitted game via foreign key

This way you can track more accurately which manager submitted, when the score was submitted, and what score was submitted. Much better for keeping an audit trail, but more complex and more coding required. But it solves the problem of staring at a status code of "2" and wondering when the submissions came in and if they really did match.

12-06-2010, 09:37 PM
Thank you :)