title: How to use inner join on a MySQL table using PHP?
body: <p>I have two tables like this:</p>
  
  <p><strong>Employee</strong></p>
  
  <pre><code>EmployeeID  EmployeeName
  1234        Jessica
  1235        Tiffany
  1236        Kayla
  1237        Jackson
  1238        Junior
  1239        Ray
  1240        Raymond
  </code></pre>
  
  <p>And...</p>
  
  <p><strong>Form</strong></p>
  
  <pre><code>IDForm Form_EmployeeID Content AgreementBy  Verificationby  Validateby  receiver
  
  1      1234            abcde   1235         1236            1237        1240
  
  2      1238            dcbe    1235         1239            1237        1240 
  </code></pre>
  
  <p>The problem is, I want to display a data like this:</p>
  
  <p>I have tried use this code:</p>
  
  <pre><code>$id=$_GET['id'];
  
  $sql=mysql_query("SELECT Employee.*, Form.*
                          FROM Form
                          INNER JOIN Employee ON Form.Form_EmployeeID= Employee.EmployeeID
                          where Form.FormID = '$id'") or die(mysql_error()); $data=mysql_fetch_array($sql);
  </code></pre>
  
  <p>But the data appears just like this:</p>
  
  <pre><code>Form ID        : 1
  Employee Name  : Jessica
  Content        : abcde
  Agreement By   : 
  Verification By: 
  Validate By    : 
  Received By    : 
  </code></pre>
  
  <p>or like this:</p>
  
  <pre><code> Form ID        : 1
  Employee Name  : Jessica
  Content        : abcde
  Agreement By   : 1235
  Verification By: 1236
  Validate By    : 1237
  Received By    : 1240
  </code></pre>
  
  <p>May I know where is the mistake?</p>