Hello
I’m working to create a quiz website. But i have a problem with (How to denied the viewed questions for a member).
Let’s me explain it:
I’ve 3 table in my database.
-
The first table called “members” to store the members details like memberID, memberName, etc…
-
The second table called “denied_questions” is stored the answered questions and it’s contains two field (qustionID, memberID).
-
The third table called “questions” is contains the questions list.
Now. I want to get a random question from questions table. The question should not be viewed to the member in the past.
The following SQL does not working!
SELECT
qus.qusID,
qus.question
FROM
`questions` AS qus,
`denied_qus` AS denied
WHERE
denied.memberID != 3 AND qus.qusID != denied.qusID
ORDER BY RAND()
I just want to get a random question from the questions table and compare this question with the answered questions from the “denied_questions”
table.
Any idea please?