title: display while loop results on next page?
body: <p>Hi i have a function that collects a list of posts added by users and displays it in a while loop down the page. </p>
  
  <p>I have limited the number of results diplayed i.e. LIMIMT 15 so it doesnt overflow on the page. but what i want to be able to do now is have all the other results (however many a user may add) to display on the next page. Each page only ever showing 15 results. So you end up with page 1, page 2, page 3 etc.</p>
  
  <p>How is this achieved?</p>
  
  <pre><code>function get_forum() {
              global $connection;
              global $profile_id;
              $query = "SELECT *
                          FROM ptb_forum
                          WHERE ptb_forum.deleted ='0'
                          ORDER BY ptb_forum.date_added DESC
                          LIMIT 0 , 16";
              $forum_set = mysql_query($query, $connection);
              confirm_query($query, $connection);
              return $forum_set;
          }
  
  &lt;?php
      $forum_set = get_forum();
  
      ?&gt;
      &lt;br/&gt;
      &lt;h3&gt;Latest Forum Posts&lt;/h3&gt;
      &lt;br/&gt; 
  
      &lt;?php
      if(mysql_num_rows($forum_set) &gt; 0) {
          while ($forum = mysql_fetch_array($forum_set)) {
              $age = days_from_date($forum['date_added']);
              ?&gt;
              &lt;div class="prof-content-box-forum" id="reviews"&gt;
               &lt;div class="forum-content"&gt;
               &lt;?php echo "{$forum['content']}"; ?&gt;
               &lt;/div&gt;
               &lt;div class="message_pic"&gt;
               &lt;?php echo "&lt;a href=\"profile.php?id={$forum['from_user_id']}\"&gt;&lt;img width=\"50px\" height=\"50px\"  src=\"{$prof_photo}\"&gt;&lt;/a&gt;";?&gt;
  
               &lt;/div&gt;
  
               &lt;div class="forum-text"&gt;
               &lt;?php echo "Posted by {$forum2['display_name']}"; ?&gt; &lt;?php echo "".$age." days ago"; ?&gt;
            &lt;/div&gt;
  
               &lt;/div&gt;
  
               &lt;? } } ?&gt;
  </code></pre>