title: PHP & mysql display data from multiple table
body: <p>I have two table which contain have data like as mentioned below:</p>
  
  <pre><code>Table1
  
  TID     Name
   1      Salman 
   2      ABC 
   3      XYZ
  </code></pre>
  
  <p>Table2</p>
  
  <pre><code>SID     STID   SUBJECT
   1       1      English
   2       1      Math
   3       2      Physics
   4       2      Math
  </code></pre>
  
  <p>Table1 TID foreign key in Table2 STID. I want to collect data from two table and display in PHP as mentioned below:</p>
  
  <pre><code>Name        Subject1    Subject2
  Salman      English     Math
  ABC         Physic      Math
  </code></pre>