I'm guessing your reply was directed at my response, since I'm the one that mentioned auto-increment. I am certainly aware that you needn't add the auto-increment field to your insert statement. What I was assuming and alwaysbrasilian later confirmed was that he has another table with user information. His primary key in that table could be an auto-increment, SSN, Student ID, whatever as long as it's unique. That ID would be a foreign key in this table that links the quiz results to the student who took them. If the student can take the quiz more than once, it would not be unique. And since it is not the primary key in this table it should certainly be added. No?
I was referring to this chunk of code... He has "Where ID = '1' which is going to update the same record over and over:
UPDATE lesson01 SET Q01='$Q01', Q02='$Q02', Q03='$Q03' Where ID='1' ";
I agree with you, jlavik, that he should be using something similar to:
$sql = "INSERT INTO lesson01 (Q01, Q02, Q03, ID) VALUES ('$ques[0]' , '$Q02', '$Q03', $User_ID)";
Because then he would have "ID" which would be the PK for the other user_table's PK. My point was that there should be another auto-increment "quiz_ID" that can keep track of each individual quiz.