Display the latest comment entered
<p>I have a posts table and a comments table where for a single post there will be number of comments added to it.There is a php table where I display the data.<br>
In this table i want to display the the latest comment for a post when ever it is added.</p>

<p>Post table,where the posts are added:</p>

<pre><code>       Posts 
+-------+---------+
|  id   | Post    |
+-------+---------+
|   1   |   ABC   |
|   2   |   DEF   |
|   3   |   GHI   |
+-------+---------+
</code></pre>

<p>Comment table where number of comments will be added to a particular post:</p>

<pre><code>   Comments
+----------+---------+
|  Post_id | Comment |
+----------+---------+
|   1      |   A     |
|   1      |   D     |
|   3      |   F     |
|   3      |   V     |
|   3      |   B     |
+----------+---------+
</code></pre>

<p>Here post_id is taken from the id of the post table.</p>

<p>I want the post with a latest comment to be displayed in this table:</p>

<pre><code>&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Post&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;?php foreach($results as $key=&gt;$row) { ?&gt;
    &lt;tr&gt;
       &lt;td&gt;&lt;?php echo $row['Comment'];?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;?php } ?&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>For example:</p>

<pre><code>+----------+---------+
|  Post    | Comment |
+----------+---------+
|   ABC    |   D     |
|   GHI    |   B     |
+----------+---------+
</code></pre>

<p>Thanks in advance.</p>