Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8832905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:38:54+00:00 2026-06-14T08:38:54+00:00

I think I’m stuck and I really hope someone can help me out here.

  • 0

I think I’m stuck and I really hope someone can help me out here.

So, I’m trying to make something like a quiz application with PHP and JS. The idea is that the user is given a picture with 4 possible answers and he has to guess what’s in that picture. User receives x points based on the answer he clicked and gets redirected to the next page, with picture and answers, and so on. There’s also a chance for user to skip to the next page. Here’s the thing though:

How do I check if the user has already answered particular question, so I could redirect him to the next page if this one has already been answered? Basically, it would be like a protection from cheating, so that the user couldn’t get more and more points from the same question.

I’m currently stuck with MySQL solution, to make column for every page, store values there and then compare them when user tries to access particular page, redirecting him based on the stored value. Is it the only solution?

I’m sorry if my english isn’t that good, and I hope you guys can understand my question. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:38:55+00:00Added an answer on June 14, 2026 at 8:38 am

    You mentioned, that user can log in and log out. Therefore I presume, that you already have a database of users and you want to store somehow which questions were already answered by particular user, but you don’t know, what’s the proper way of storing such information into MySQL database.

    Now, I am sorry if I got wrong, what you meant, but if my assumptions are correct, then there are several ways, how to store the data you want to save. You can for example add another column to the table with users, that will contain the last question that the user answered. And you can update that value everytime user answers next question.

    So i.e. if you had 4 questions, the column would be empty. When you come to the page with question, you look into database, what’s the last question this user answered. Since this user didn’t answer any question thus the column is still empty, you can ask him the first question. If he answers, you can update now the column with value 1. Next time the same user accesses page with questions, you look again into database into the very same column and you will get value 1. So now you now, you’ve already asked first question and you can ask the user the next question.

    In case questions are not asked in specific order and can be presented randomly, you have other possible solution: Create a reference table. You can create new table, which will contain three columns: user_id, question_id and answer to that question(if you need to save the answer too). Now everytime user opens the page that generates questions, you can look into your table with questions and select all those questions, that are not answered by the user. So you do something like this:

    SELECT * 
    FROM questions_table 
    WHERE question_id NOT IN 
    (SELECT question_id 
    FROM questions_answered_by_users 
    WHERE user_id=$currentUserId)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I have a fairly basic question here. I'm not trying to waste
Think I have an integer array like this: a[0]=60; a[1]=321; a[2]=5; now I want
Think my problem is I am trying to sum a count in the same
I think I've figured out the problem. I'm using a IP webcam stream, doing
I think I have a basic understanding of this, but am hoping that someone
Think 2 entities OneToOne mapped. Person and Car. A Person can have a Car.
Think about a speedometer, and imagine all these little strokes around it like 10
Think about the games like Spiral Knights and Minecraft(Which I believe both use LWJGL)
Think of a Pinterest, when someone takes a picture and uploads that picture, where
i think this should be very easy , but i really don't know how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.