title: PHP MySQL inner join with same column name
body: <pre><code>$q = $db-&gt;query("SELECT * 
          FROM people p
          INNER JOIN job j           
          ON p.job_id = j.id
          WHERE p.id = '$id'
          ORDER BY j.id ASC");
      $maps = array();
      while($row = mysqli_fetch_array($q)) {
          $product = array(
              'id' =&gt; $row['id'],
              'job_id' =&gt; $row['j.id']
          )
      }
  </code></pre>
  
  <p><strong>table people</strong></p>
  
  <p><code>id</code></p>
  
  <p><strong>table job</strong></p>
  
  <p><code>id</code></p>
  
  <p>In the above code I am doing an inner join between two tables. Both tables have an a column called <code>id</code> is there a way to differentiate between the two in my <code>while loop</code>?</p>
  
  <p>I have tried the above but <code>$row['j.id']</code> doesn't work and if I do <code>$row['id']</code> then it writes both <code>id</code> and <code>job_id</code> with the same value.</p>