title: Info from two sql tables to one HTML table
body: <p>I Have tables like invoice &amp; expenses output looks like this:</p>
  
  <p>invoice
  <a href="https://i.stack.imgur.com/u6u4N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u6u4N.png" alt="enter image description here"></a></p>
  
  <p>expenses:
  <a href="https://i.stack.imgur.com/lTnv5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lTnv5.png" alt="enter image description here"></a></p>
  
  <p>How I can display these two tables in on table ordered by date ( Kuupäev)
  with my example first row must by from expenses 01-02-2015
  next from invoice 14-08-2015 / 16-08-2015 / 16-08-2015 and then from expenses 17-08-2015</p>
  
  <p>when invoice query is:</p>
  
  <pre><code>     $results = $mysqli-&gt;query(" SELECT * FROM tulu T1 
    INNER JOIN artikkel A1 on T1.artikkel_id = A1.artikkel_id 
    INNER JOIN liige L1 on T1.liige_id = L1.liige_id
    INNER JOIN maksja M1 on T1.maksja_id = M1.maksja_id
    ORDER BY kuup2ev ;
  </code></pre>
  
  <p>And table displayed with code:</p>
  
  <pre><code>print '&lt;table class="mytable4"&gt;';
  echo "&lt;tr&gt;&lt;th&gt;Kuupäev &lt;/th&gt;&lt;th&gt;Artikkel &lt;/th&gt;&lt;th&gt;Maksja &lt;/th&gt;&lt;th&gt;Summa&lt;/th&gt;&lt;th&gt;Kommentaar&lt;/th&gt;&lt;th&gt;Sisestaja&lt;/th&gt;&lt;/tr&gt;";
  while($row = $results-&gt;fetch_array()) {
  $timestamp = strtotime($row['kuup2ev']);
  
   print '&lt;tr&gt;';
    print '&lt;td&gt;'.$date = date('d-m-Y', $timestamp).'&lt;/td&gt;';
     print '&lt;td&gt;'.$row["a_nimi"].'&lt;/td&gt;';
      print '&lt;td&gt;'.$row["m_nimi"].'&lt;/td&gt;';
      print '&lt;td&gt;'.$row["summa"].'&lt;/td&gt;';
      print '&lt;td&gt;'.$row["kommentaar"].'&lt;/td&gt;';
      print '&lt;td&gt;'.$row["nimi"].'&lt;/td&gt;';
   print '&lt;/tr&gt;';
  }  
  print '&lt;/table&gt;';
  </code></pre>
  
  <p>The expenses query is:</p>
  
  <pre><code>SELECT * FROM kulu K1 
    INNER JOIN artikkel A1 on K1.artikkel_id = A1.artikkel_id 
    INNER JOIN liige L1 on K1.liige_id = L1.liige_id
    ORDER BY kuup2ev ;
  </code></pre>
  
  <p>sql tables:
  expenses
  <a href="https://i.stack.imgur.com/XHNRe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XHNRe.png" alt="enter image description here"></a></p>
  
  <p>invoice
  <a href="https://i.stack.imgur.com/0lBwy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0lBwy.png" alt="enter image description here"></a></p>