I am total newbie to PHP so apologies for dumb questions.
After a lot of searching online, tearing my hair out and trial and error I have managed to set up an HTML form and a database which then accepts the inputs from that form.
I now would like to be able to display some summary statistics from the form data.
Simplistically, I have a table with the following data in it:
NAME SCORE1 SCORE2 SCORE 3
John 1 2 3
Philip 3 5 6
Paul 3 2 3
Peter 7 3 2
Mike 2 2 3
I would like to be able to find the average of column SCORE1 (3.2) and then the number which occurs most often in the other columns (the mode - 2 and 3 respectively). All the score fields have a type of INT.
Can anyone help me please to code this so I can simply display the average of score1 and then the mode of score2 and the mode of score3 in a browser something like below:
The average of SCORE1 is 3.2.
The mode of SCORE2 is 2.
The mode of SCORE3 is 3.
Thank you
Jason