title: MYSQL select newest posts from tables
body: <p>I want to select the newest posts from users, I am looking for the most efficient way to do this. </p>
  
  <p>Currently this selects the first post, not the last:</p>
  
  <pre><code>$query = mysql_query("
                       SELECT * 
                       FROM posts 
                       WHERE toID=fromID 
                       GROUP BY fromID 
                       ORDER BY date DESC LIMIT 3");
  </code></pre>
  
  <p>Table Structure:</p>
  
  <p>Table: posts</p>
  
  <pre><code>id  ToID    FromID  Post        State   Date
  1   1       1       Hey         0       1325993600
  2   1       6       okay yeah   0       1325993615
  3   1       2       again       0       1325994600
  4   6       6       yeah2       0       1325995615
  </code></pre>
  
  <p>so from this above example it would return id: 1 and 4.</p>
  
  <p>toID=fromID is just to get the post that is a status message, meaning the user posted something on their own page, not someone elses. </p>
  
  <p>I want to get the most recent status from the last 3 users that have updated their status. </p>