I have made a score system, which sum up multiple points for a team. It's made using PHP, MySQL and HTML.
Each team can get one point (lets say a number between 1 and 10) pr. task. The system handles multiple tasks.
Each team is represented by a row in the table "teams". Each task is represented by a row in the table "tasks" Every point is represented by a row in the table "points".
Now I want to make a HTML which show all of these data in a single HTML table.
The structure of "teams" is
ID | TeamName
The structure of "tasks" is
ID | TaskName
The structure of "points" is
ID | Team | Task | Point
Now I want to create a table which look like the following:
Teams | Task x | Task y | Total |
-------|----------|----------|-----------|
Team 1 | 3 points | 1 point | 4 points |
-------|----------|----------|-----------|
Team 2 | 9 points | 2 points | 11 points |
-------|----------|----------|-----------|
Team 3 | 5 points | 8 points | 13 points |
I have made a solution which does, what I want. The problem is, that it's made with loops inside loops which slows the load. And that's critical because I have like 200 teams and 50 tasks.
So can anyone help me with a hint to do this smarter?