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.
– Roberto de Campos
better define the database structure, the way it is, if possible put some images of the tables and relations of your database
– Gabriel Gonçalves
@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?
– Thiago
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 aN
it is necessary to create an auxiliary table'.– Roberto de Campos