Scoring system
This will likely be custom support needing a paid ticket (which isn't a problem), but its got to start somewhere.
I'm looking to add a scoring system to an existing database.
There is currently a table 'lodges', and the objective is to have a series of questions where voters can give a score out of 10 for a lodge for each question.
So an example question might be:
index5.php
This inserts a record in a table 'scores' with the field:
LodgeID (to link back to the lodges table) - hidden field pulling through the LodgeID from the query on the page.
Question which is currently just a number (maybe worth having a third table 'questions' - also a hidden field.
Score ID - unique PK for the 'scores' table.
Score - the score based on the selection made.
So for example, that gives a table with records like:
ScoreID, LodgeID, Question, Score
1, 288, 1, 10
1, 288, 1, 8
1, 288, 1, 6
1, 288, 1, 4
1, 288, 1, 2
So far so good - the part I would need help with is to calculate and store:
1. The number of votes cast for any question for any lodge.
2. The average score received for that question.
So with the sample data above LodgeID 288 has had 5 votes cast for question 1, with an average score of 6.
I hope that makes sense - it may be that the table fields / structure is all wrong, or at least needs additional fields somewhere to store the calculated fields, but I wanted to at least try to make a start so it might make some sense.
If you could steer me in the right direction, or even help out with some paid support that would be appreciated as ever.