Reputation: 1850
I'm trying to build a quiz script in PHP (most of the presentation logic is done with JS, but the scripts for querying the DB are PHP).
I've managed to setup the script to query the DB for a random question at every run.
But
I have no way of knowing if the user has already answered this question or no, so they can get the same question over and over again.
Also, now that I'm thinking about it - I have no way of knowing if the user went over all the questions in the DB! (Which is the goal of the quiz script in the first place).
How do I go about doing this? (I'm not sure if this is more of a DB question or a general practice question - let me know if SO is not the place).
Upvotes: 0
Views: 105
Reputation: 31173
well, depending on what you want to do, you have 2 options:
1) if you want to store all the data, create a separe DB table and you have 2 options:
2) if you don't want to store data but only want a full single sessions, use cookies and/or $_SESSION then.
Upvotes: 1