title: PHPmyadmin how to use double primary key for reference to 2 foreigen key with correct combinations
body: <p>I have a problem with mysql via phpmyadmin. 
  I have a table with teachers (tid, name) and with subjects (sid, name). Because this is a n:m cardinality, i made a third table called teacher_subjects with 2 primary keys (tid, sid).</p>
  
  <p>This combination I want to use for a fourth table called booking (lid, date, tid, sid). How can I set a foreign key to the table teachers_subjects with correct combinations?</p>
  
  <p>I managed to built up the tables including their relationships completely, but in the table booking I am also able to choose combinations that are not implemented in the table teacher_subject.</p>
  
  <p>I think that has to work with multiple foreign keys, but I don`t know how to manage this.</p>