How to matched the column from 2 different tables using php
<p>From the code, I want these 2 tables <strong>(personal and information)</strong> to compare whether it has the same <strong>location</strong> or not. If there is a matched, I want to display the data from <strong>personal table</strong> as stated at the comment. </p>

<pre><code>$selectall = "SELECT * FROM information";
$stmt = mysqli_query($connection, $selectall);

$compare = "SELECT * FROM personal INNER JOIN information ON personal.location = information.location";
$comparing = mysqli_query($connection, $compare);

while($row = mysqli_fetch_array($stmt)) {
   $output .= '&lt;tr&gt;
               &lt;td&gt;' .$row['name']. '&lt;/td&gt;
               &lt;td&gt;' .$row['location']. '&lt;/td&gt;
               &lt;td&gt;' .$row['postal']. '&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
               &lt;td&gt;//This is where I want to show the matched data from personal table&lt;/td&gt;
               &lt;/tr&gt;';
}
</code></pre>