Display 5 most recent forum posts
<p>So I have 3 tables inside of my database, let's say 1_comments, 2_comments and 3_comments and I want to display the latest 5 posts of all 3 tables at once in PHP and sort by the most recent time. My code is:</p>

<pre><code>&lt;?php
  $row="";

  $link = mysql_connect("localhost","username","password");
  mysql_select_db("database");
  $query = "SELECT * from 1_comments  ORDER by timestamp DESC limit 5";
  $result = mysql_query($query);

  while($row = mysql_fetch_array($result)) {
    echo "&lt;ul&gt;";
    echo "&lt;li&gt;".$row['comment']."&lt;/li&gt;";
    echo "&lt;/ul&gt;";
  } 

  mysql_close($link);
?&gt;
</code></pre>

<p>So it's taking the most recent 5 posts from the comments row on 1_comments and sorting them by their most recent timestamp, but I can't seem to get it working for 1_comments, 2_comments and 3_comments all at once.</p>
