There are three tables involved here.
A kind of quiz localhost site, i did for me.
Table 1 contains questions.
==========================
question_id (autoincrement)
questions (varchar 250)
category_id
Table 2 contains choices
========================
Choice_id (autoincrement)
Choice_value (varchar)
question_id
Table 3 contains answers
========================
question_id
choice_id
I am displaying 10 questions from every category
Code: Select all
select * from questions where cat_id = 3 ORDER BY RAND() LIMIT 10Code: Select all
select * from choice where question_id = xx