Merge and display data from different table with PHP
<p>I'm editing a program in PHP and I want to display a table with data from different table.
Now I have 2 tables and I am only printing the first table (registro_eu) with this code:</p>

<pre><code>$sql = "SELECT * FROM registro_eu WHERE MONTH(data_conv) = 7 AND YEAR(data_conv) = 2016";
$result = $conn-&gt;query($sql);

if ($result-&gt;num_rows &gt; 0) {
    echo '&lt;div class="table-responsive"&gt;';
    echo '&lt;table class="table table-striped"&gt;';
    echo '&lt;thead&gt;
                    &lt;tr&gt;
                      &lt;th&gt;Date&lt;/th&gt;
                      &lt;th&gt;Desc&lt;/th&gt;
                    &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;';

    while($row = $result-&gt;fetch_assoc()) {

        echo '
                    &lt;tr&gt;
                        &lt;td&gt;'. $row["data"].'&lt;/td&gt;
                        &lt;td&gt;'. $row["desc"].'&lt;/td&gt;
                    &lt;/tr&gt;';
    }

    echo '&lt;/tbody&gt;';
    echo '&lt;/table&gt;';
    echo '&lt;/div&gt;';

}
</code></pre>

<p>TABLE REGISTRO_EU:</p>

<pre><code>ID | DATE       | DESC
-----------------------------
1  | 2016-06-15 | TEST DESCT
2  | 2016-06-15 | TEST 2
3  | 2016-06-15 | TEST 3
4  | 2016-06-16 | TEST DESCT
5  | 2016-06-16 | TEST 4
6  | 2016-06-17 | TEST 5
</code></pre>

<p>TABLE FONDI:</p>

<pre><code>ID | DATE       | TOT
-----------------------------
1  | 2016-06-15 | 88
2  | 2016-06-16 | 100
3  | 2016-06-17 | 120
</code></pre>

<p>And I want to display to user (with php) something like this:</p>

<pre><code>DATE       | DESC        |TOT
-------------------------------
2016-06-15 | TEST DESCT  |
2016-06-15 | TEST 2      |
2016-06-15 | TEST 3      |88
2016-06-16 | TEST DESCT  |
2016-06-16 | TEST 4      |100
2016-06-17 | TEST 4      |120
</code></pre>