title: Display entries from a database, list them from newest to oldest and stop after a certain amount?
body: <p>I have the following tables in my DB:  </p>
  
  <ol>
  <li>id</li>
  <li>title</li>
  <li>heading</li>
  <li>content</li>
  <li>date</li>
  <li>tags</li>
  <li>username</li>
  <li>like</li>
  <li>dislike</li>
  <li>comments</li>
  </ol>
  
  <p>I have the database hooked up so that it will show what's in the rows, but I don't know how to  make it so that it will generate and list a "post block" every time a new entry is made. I would also like to list them from newest posts to oldest, all while limiting the posts to 10-20 per page.</p>
  
  <pre><code>&lt;?php
  
  $connect = mysql_connect('localhost','root','','andrewryan') or die('error connection');
  
  mysql_select_db('andrewryan');
  
  $query = "Select * FROM entry";
  $result = mysql_query($query);
  $row = mysql_fetch_array($result);
  
  $username = $row['username'];
  $title = $row['title'];
  $heading = $row['heading'];
  $content = $row['content'];
  $tags = $row['tags'];
  $like = $row['like'];
  $dislike = $row['dislike'];
  $comment = $row['comment'];
  $date = $row['date'];
  ?&gt;
  </code></pre>
  
  <p>I also have another page with just one block of html. Which is the post framework with all the variables given where they are needed. Any reference for what I'm going for can be found at this link if it helps: <a href="http://andrewryan.me" rel="nofollow">HERE</a></p>