title: PHP MySQLi While Loop
body: <p>I am facing some problems when creating my while loop within PHP.
  I want to be able to pull data out from multiple tables within a while loop. For example I have a table called Invoices and a second table called Customers. Both tables have a field named Email, and whenever I am trying to print or echo that row, then I only get one of them.. Maybe you could have a look at my code.</p>
  
  <pre><code>    &lt;?
      $invoice_edit_query = $db-&gt;query("SELECT * FROM invoices, customers 
      WHERE invoice.customer_id = kunder.id AND
      invoices.kunde_id = '$_GET[edit]' AND
      invoices.invoice_year = '$_GET[year]' AND
      invoices.invoice_nr = '$_GET[nr]'") or die(mysqli_error($db));
  
      while($row = $invoice_edit_query-&gt;fetch_object()){
          ?&gt;
          &lt;td&gt;Email: &lt;input type="text" name="email" value="&lt;? print $row-&gt;email; ?&gt;"&gt;&lt;/td&gt;
          &lt;?
      }
      ?&gt;
  </code></pre>
  
  <p>Is there a way to print the values of my tables like the WHERE statement invoices.email or customers.email? Maybe instead of writing:</p>
  
  <pre><code>    $row-&gt;email;
  </code></pre>
  
  <p>then writing:</p>
  
  <pre><code>    $row-&gt;invoices.email;
  </code></pre>