title: PHP and MySQL: Order by most recent date and limit 10
body: <p>I am building a notes system on my site and I've got to the stage where users can post notes into the MySQL database using PHP and then PHP prints them out on a page. However, when they print/echo out, the oldest one appears first but I want the most recent first. I also want them to be limited to 10, so only 10 appear on the page. Here is my PHP code, your help will be much appreciated:</p>
  
  <pre><code>// initialize some variables
  $notedisplaylist = "";
  $myObject = "";
  $result = mysql_query("SELECT * FROM notes WHERE note_author_id='$u_id' ORDER BY         date_time");
  
  while($row = mysql_fetch_array($result)){
    $note_title = $row["note_title"];
    $note_body = $row["note_body"];
    $date = $row["date_time"];
    $notedisplaylist .= '&lt;h2&gt;' . $note_title . '&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;' . $note_body . '&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;Noted: ' . $date . '&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;';
  }
  </code></pre>