title: MySQL ordering rows by
body: <p>I'm trying to pull data from my <code>forum_topics</code> and <code>forum_replies</code> tables to get the last reply date;</p>
  
  <pre><code>SELECT 
      (SELECT date FROM forum_replies WHERE topic=5 AND date &lt; NOW()
      ORDER BY id DESC LIMIT 1) as lastreply, 
      ft.* FROM forum_topics ft
      ORDER by lastreply DESC LIMIT 5
  </code></pre>
  
  <p>It's getting the <code>lastreply</code> data in the recordset, but not using it to ORDER the rows of the recordset. </p>
  
  <p>I can see why, but not sure how to fix it?</p>