My timetable table looks like this:
  id  period   mon   mon_tch   tue   tue_tch   wed   wed_tch
  --  ------   ---   -------   ---   -------   ---   -------
   1   prd1     4       5       8        7      6       3    
   2   prd2     6       3       4        5      8       7
My teacher-subject table:
   id   tchr   subject
   --   ----   -------
    1     5       4
    2     7       8  
where values in mon is the subject_id and mon_tch is the teacher_id and so on.
When admin changes the subject of a teacher in the 'teacher-subject' table via a form (example: subject of teacher with id 5 is changed from 8 to 9), I want to update my timetable table with the new subject assigned.
(consider the subject field in the teacher-subject table will be updated somehow).
 
    