The tables given below shows that every rows in the 'questions' table is assigned to four rows in the 'answers' table. I wonder how to select randomly four questions and sixteen answers and then display them separately. I want to gain the following effect:
If I write this query: SELECT question FROM questions WHERE epoch_id = 2 AND id = 4; then the result is: question number 4
If I write this query: SELECT answer FROM questions JOIN answers ON questions.epoch_id = 2 AND questions.id=answers.question_id AND answers.question_id = 4; then the result is four times: answer number 4 answer number 4 answer number 4 answer number 4
What do I have to do if I want to gain more rows from the 'answers' table?
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum