Question
Create a league table in mysql & PHP
hi, was wondering if anyone could help?;
I want to calculate a classes total praise and then compare it to other classes totals to create a league table of scores.
Explanation of tables and feilds:
I have two table, student and teacher.
student(Student_id, name, year_group, form, praise)
teacher(teacher_id, name, form, total_praise)
students get given 'praise' this is stored in the database as an int.
each student is grouped in to a 'form' and each teacher has a form full of students.
i want to be able to calculate the total praise for a form and then compare that total to all the other forms totals and create a league table.
What is working:
i can total the praise for a specific form.
what i can not do:
at the minute the total_praise in the teachers table is empty.... I want the total praise for the class to be added here automatically. so i can then just compare this for the league table.
Any help would be much appreciated,
Thanks, Gavin
I want to calculate a classes total praise and then compare it to other classes totals to create a league table of scores.
Explanation of tables and feilds:
I have two table, student and teacher.
student(Student_id, name, year_group, form, praise)
teacher(teacher_id, name, form, total_praise)
students get given 'praise' this is stored in the database as an int.
each student is grouped in to a 'form' and each teacher has a form full of students.
i want to be able to calculate the total praise for a form and then compare that total to all the other forms totals and create a league table.
What is working:
i can total the praise for a specific form.
what i can not do:
at the minute the total_praise in the teachers table is empty.... I want the total praise for the class to be added here automatically. so i can then just compare this for the league table.
Any help would be much appreciated,
Thanks, Gavin
