title: pagination code with previous and next button . using jquery ajax
body: <p>i am using jquery ajax pagination code, i need some changes.</p>
  
  <pre><code>&lt;?php
  $per_page = 4;
  $sql = "select * from portfolio  ";
  $rsd = mysql_query($sql);
  $count = mysql_num_rows($rsd);
  $pages = ceil($count/$per_page)
  ?&gt; 
  </code></pre>
  
  <p>the above code calculates the number of pages then </p>
  
  <pre><code>  &lt;?php
      //Show page links
      for($i=1; $i&lt;=$pages; $i++)
      {
          echo '&lt;li  class="pagenum" id="'.$i.'"&gt;'.$i.'&lt;/li&gt;';
      }
  ?&gt;
  </code></pre>
  
  <p>this code display pagination button that is basically</p>
  
  <p><code>&lt;li  class="pagenum" id="'.$i.'"&gt;'.$i.'&lt;/li&gt;</code></p>
  
  <p>all the problem is here with $i . </p>
  
  <p>if $per_page=4 then 7 pagination button appears . </p>
  
  <p>pagination occur on basis of </p>
  
  <pre><code>id="'.$i.'"
  </code></pre>
  
  <p>this way </p>
  
  <pre><code>$("#paging_button li").click(function(){
          //show the loading bar
          showLoader();
  
          $("#paging_button li").css({'background-color' : ''});
          $(this).css({'background-color' : '#ccc'});
  
          $("#contentt").load("data.php?page=" + this.id, hideLoader);
      });
  </code></pre>
  
  <p>what i want is to display only next and previous button . instead of seven pagination buttons .</p>
  
  <p>need to change to logic/code .</p>
  
  <p>please help </p>
  
  <p>thanks</p>