title: Bootstrap Pagination using PHP & MySQL
body: <p>I am kind of new to Bootstrap, I am trying to implement pagination on one of the sections in my page to represent the data properly. Can anyone please help?</p>
  
  <p>Here is a snapshot of how the code looks right now. How can I implement pagination so that only 10 records are displayed? Thanks.</p>
  
  <pre><code>&lt;section class="success" id="all-confessions"&gt;
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-12 text-center"&gt;
                  &lt;h2&gt;All Confessions&lt;/h2&gt;
                  &lt;hr class="star-light"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="row text-left"&gt;
                  &lt;?php
                  $allconfession = mysql_query("SELECT * FROM collection ORDER BY date DESC");
  
                  while($result2 = mysql_fetch_array($allconfession)) {
                      $id = $result2['id'];
                      ?&gt;
                      &lt;div class="col-md-3 col-md-offset-1"&gt;
                          &lt;h5&gt;#&lt;?php echo $id; ?&gt;&lt;/h5&gt;
                      &lt;/div&gt;
                      &lt;div class="col-md-10 col-md-offset-1"&gt;
                          &lt;p class="para-confess"&gt;
                              &lt;?php
                              echo $result2['type'] ." from ". $result2['college'] ." of ". $result2['department'] ." confessed ". $result2['confession']; 
                              ?&gt;
                          &lt;/p&gt;
                          &lt;div class="text-left"&gt;
                              &lt;?php
                              if(isset($_COOKIE['uname'])) {
                                  ?&gt;
                                  &lt;form action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post"&gt;
                                      &lt;input type="text" name="cid" style="display: none;" value="&lt;?php echo $id; ?&gt;"&gt;
                                      &lt;button type="submit" class="btn btn-success fa fa-thumbs-up" name="like"&gt; Cool&lt;/button&gt;
                                      &lt;button type="submit" class="btn btn-warning fa fa-thumbs-down" name="dislike"&gt; WTF&lt;/button&gt;
                                  &lt;/form&gt;
                                  &lt;?php
                              }
                              ?&gt;
                          &lt;/div&gt;
                          &lt;div class="text-right"&gt;
                              &lt;i class="fa fa-thumbs-o-up"&gt; 
                                  &lt;?php 
                                  $likes = mysql_query("SELECT COUNT(*) FROM activity WHERE cid = $id AND ld = 1");
                                  $alikes = mysql_fetch_row($likes);
                                  echo $alikes[0]; 
                                  ?&gt; 
                              &lt;/i&gt; &amp;nbsp;
                              &lt;i class="fa fa-thumbs-o-down"&gt; 
                                  &lt;?php 
                                  $dislikes = mysql_query("SELECT COUNT(*) FROM activity WHERE cid = $id AND ld = 0");
                                  $adislikes = mysql_fetch_row($dislikes);
                                  echo $adislikes[0]; 
                                  ?&gt; 
                              &lt;/i&gt;
                          &lt;/div&gt;
                          &lt;hr/&gt;
                      &lt;/div&gt;
                      &lt;?php
                  }
                  ?&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>