title: PHP best way to display x results per page
body: <p>I have a database with many entries which contain datetime fields as well.
  Right now the index is an md5 hash value which gets calculated from other fields including the date, making each entry unique. </p>
  
  <p>What would be the best way to display let's say 50 results per page from this database? Could you provide a php example?</p>
  
  <p>I might not see this right but this would be a lot easier if I would use an integer ID field as a unique key (which gets auto incremented) because then I could query the last ID like 9412 and do a -50 to get the last 50 results for the first page then do a  -50 to get the previous 50 results on the 2nd page when the user clicks on the arrow.</p>
  
  <p>The only problem with this is that I do REPLACE INTO this db to avoid duplicate entries by the hash. If the ID is an auto incrementing integer this might wouldn't work.</p>
  
  <p>Thanks.</p>