i’m new to mySQL. i have created a join table from two tables:
students
===============================
id(auto)
name
homeworks
===============================
id(auto)
description
students_homeworks
===============================
idStudentHomework(auto)
idStudent
idHomework
a student should fill a form in my website and provide his name and homework description. as far as i know, i sould then query the database in my php code and INSERT student.name and homework.description to respective tables.
but how should i fill the students_homeworks table?
should i query the two tables again and find the IDs and then fill the join table?
(i googled it but just found how to create join tables and SQL JOIN command)
1 Answer