title: Fetching the last post of the forum
body: <p>I build a forum system and I have a problem with fetching the last post.</p>
  
  <p>Here is the query:</p>
  
  <pre><code>SELECT 
      posts.date, posts.author AS pauthor, topics.*,
      CASE 
         WHEN posts.date &gt; topics.date THEN posts.date 
         WHEN topics.date &gt; posts.date THEN topics.date
      END AS ldate
  FROM 
      posts, topics 
  WHERE 
      topics.id = posts.topic_id 
      AND forum_id = ? 
  ORDER BY 
      ldate DESC 
  LIMIT 1
  </code></pre>
  
  <p>The problem is when I open a new topic is not appear unless I post a comment on this topic.</p>