I'm currently populating a form with information that I have in another mysql table.
example form:
##########################################
This section repeats for each student record that is pull from the students table in the mysql database
Student #: __________________________
(this is coming from the students table)
Student Name: __________________________
(this is coming from the students table)
Test Date: __________________________
(this is a form field at the top of the page that populates all the records when submitted)
Test Title: __________________________
(this is a form field at the top of the page that populates all the records when submitted)
Class Average: __________________________
(this is a form field at the top of the page that populates all the records when submitted)
Student Score: __________________________
(this is an empty field that the teacher will fill in)
[Submit Button]
##########################################
The above fields are repeated in the form according to how many students are in the students table in the mysql database. If there were 25 students the above would be repeated 25 times with the information being different for each student.
The Problem:
I would like to be able to submit all 25 student test scores to the tests table in the mysql database with one submit and have all 25 student scores insert as separate records. Presently when I try this it only inserts the last student in the list. I know this is happening because when I repeat the table row in the form for each student the input text field names repeat and are all the same.
The Question:
Can someone please explain to me exactly what I need to do in order to first populate a form from a database and second submit multiple separate records at once through one form to one table?
Thanks,
Michael