title: How to create a foreign key in phpmyadmin
body: <p>I want to make doctorid a foreign key in my patient table.</p>
  
  <p>So I have all of my tables created - the main problem is that when I go to the table > structure > relation view only the primary key comes up that I can create a foreign key (and it is already the primary key of the certain table that I want to keep - i.e Patient table patient is enabled to be changed but the doctor Id -I have a doctor table also- is not enabled).</p>
  
  <p>I have another table with two composite keys (medicineid and patientid) in relation view it enables me to change both</p>
  
  <p>Do I have to chance the index of doctor ID in patient table to something else? both cannot be primary keys as patient ID is the primary for the patient table - doctor is the foreign.</p>
  
  <p><a href="https://i.stack.imgur.com/s0Ang.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/s0Ang.jpg" alt="table"></a></p>
  
  <p>I hope anyone can help</p>
  
  <p>Kind regards</p>