save multiple inputs in middle table with same name
I am allowing users to add multiple subjects on the fly while adding a student, for example when you are adding a student you can add a subject i.e Math then you will set its attributes teacher name, credit hours etc. But when saving to db I need to save the information to my middle table students_subjects
id | student_id | subject_id | teacher_name | credit_hours
The problem is that how I can save the information for each subject. I can save the subject_id in a hidden field and get that but how would I know that this id is related to that particular subject and get the teacher and credit hours for that id.
Please or to participate in this conversation.
