Linking a question with a database answer

Asked

Viewed 33 times

0

I’m trying to create a question and answer system in PHP and Mysql.

I already have the bank created, I would like to know how to make the question is linked to the answer that the student made. And show in a loop all answers answered by each student.

tblperguntas id_pergunta titulo pergunta
tblrespostas id_resposta resposta 
  • You have to have one more table, where you will save the student id and answer id.

  • 1

    better define the database structure, the way it is, if possible put some images of the tables and relations of your database

  • @Robertodecampos I forgot to mention that there is an existing user table,to bring the id of the id_student and id_answer would be by Inner or foreign key?

  • It would have to be a foreign key, that’s necessary because each answer can be chosen by one or more students, so it’s a relationship 1-N, every relationship that there is a N it is necessary to create an auxiliary table'.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.