Topic: copy one whole column from one table to another

Hey guys

Little help. My project is a generic time table generator.

I have 3 tables -- teachers, subjects and relations with the following fields:

1) for teachers -- id, name
2) for subjects -- id, subject_name, no_of_hours, lab, semester
3) for relations -- subject_name, teacher_1, teacher_2.

Now, I want that subject_name (from the relations table) import all the values of name field from subjects table.

Next I want my page in this form:

                                       subject_name        teacher_1        teacher_2
                                               sub1                          ------------           ------------
                                               sub2                          -------------          ------------

So i want all the subject names to be displayed and the user inputs values for teacher1 and teacher_2 and then when he clicks on submit, then all the tuples are saved into the database.

Help please.

Thank you

Re: copy one whole column from one table to another

Now, I want that subject_name (from the relations table) import all the values of name field from subjects table.

You don't have the 'name' column in subjects table smile, only 'subject_name'. Any corrections?

Re: copy one whole column from one table to another

My bad. Typo. Its actually 'subjects_name' instead of the 'name'