Jump to content
MakeWebGames

Help on a Random Selection QUERY (:


Joshua

Recommended Posts

Ok, I'm trying to make a quiz for a mod i'm designing. The problem here is.

Im trying to select a random question from the database that the user hasnt already had.

Got that part done.

The problem I'm running into now is, when the user clicks submit for the answer, since the $db->query is selecting a random statement, the page refreshes, so does the answer and the question, into a totally differant random one >,<

How can I stop this? :P

Link to comment
Share on other sites

If you don't want to use sessions/cookies, you can create a new column on the players table or create a new table (the better option) which will store the question ID chosen for each player.

Then you can check the answer against the question saved in the database.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...