tangara goh wrote:But, it doesn't get inserted into different rows!
There could be a lot of reasons why that happens. But the code you posted doesn't let us guess which reason might be the real reason. And there's no point in attempting to list all of the possible reasons.
So here's what I would suggest. Write a small program which does nothing but create that list and then write it into several rows in your database. Use constant values to initialize the list and the other values. And then post the whole program and tell us what the result is when you run it. Make sure not to ignore error messages.
If I was doing something like this, I would separate Tutors and Subjects in to separate tables, and then have an associative/junction table to connectTutors with Subjects. Tutors and Subjects are only defined once in a single row in their corresponding table; with no unwanted redundant data. The tutor_id and subject_id columns in the TutorSubjects table would be foreign-keys referencing the id columns in the corresponding Tutors and Subjects tables.
Add a new Subject to the school's offerings:
Add an additional Subject to a Tutor's repertoire:
Get Tutors' names and rates for a particular Subject (title of MATH-1 in this example):
Get Subject title and description for a particular Tutor (ID of 2 in this example):