title: Display images with pagination from mysql
body: <p>I had a php page to display images from a mysql database. It displays all the images uploaded in 1 page one after the other. How can i display 5 or 6 images per page with pagination?</p>
  
  <p>Here is my php page.</p>
  
  <pre><code>&lt;?Php
  
      include("init.php"); 
      include("template/header.php");
  
  
      ?&gt;
      &lt;div class="view_albums"&gt;&lt;h3&gt; View Albums &lt;/h3&gt;;
      &lt;?php
  
  
  
      $album_id = $_GET['album_id'];
      $images = get_images($album_id);
  
      if (empty($images)) {
          echo 'There are no images ';
  
      } else {
  
  
          foreach ($images as $image) {
              ?&gt; &lt;div class="box"&gt;  &lt;?php
              echo '&lt;a href="uploads/', $image['album'], '/', $image['id'], '.', $image['ext'],'"&gt; &lt;img class="box1" src="uploads/thumbs/', $image['album'], '/', $image['id'], '.', $image['ext'], '"  title="Uploaded on ', date('l F j, Y \a\t g:i A',$image['timestamp']),'"&gt;&lt;/a&gt; [&lt;a href="delete_image.php?image_id="&gt;delete&lt;/a&gt;]';
              ?&gt;  &lt;?php
  
  
          }
      }
      ?&gt;
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;?php
      include("template/footer.php");
  
  ?&gt;
  </code></pre>