Hello, I am a beginner aswell, but I can direct you a little to the right direction.
You should create a Sql Table, witch would hold the user activity. And develop a simple PHP Code, witch executes a simple query to the table you created, when a logged in user enters the page of the game. Query could contain a simple information of the UserId, GamePlayed, and Time. So after this, you will be able to pull the statistics from the table about every recent user activity.
This could be a very basic solution, but for a school work it could be ok.
"Be formless... shapeless, like water. Now you put water into a cup, it becomes the cup. You pour water into a bottle; it becomes the bottle. You put water into a teapot; it becomes the teapot. Now water can flow, or creep or drip or crash! Be water, my friend..." by Bruce Lee