title: how to use limit in codeigniter controller
body: <p>I am doing ajax scrolling pagination. Controller is like below</p>
  
  <pre><code>&lt;?php
  require APPPATH . '/controllers/user/Usercontroller.php';
  
  class PaginationController extends Usercontroller{
  
      public function __construct(){
          parent::__construct();
          $this-&gt;load-&gt;model("Usermodel","",true);    
      }
  
      private $perPage = 5;
  
      public function index(){
          $tutorId=$this-&gt;session-&gt;userdata('cp_userid');
          $categorycourses=$this-&gt;Usermodel-&gt;getcourses($tutorId);
  
          $count = $categorycourses-&gt;num_rows();
  
          $data['details']=$categorycourses;          
          $this-&gt;load-&gt;view("user/pagination_view",$data,true);
      }
  }
  ?&gt;
  </code></pre>
  
  <p>$count variable contains 5 data, I want to send 3 for first page and remaining for second page. How to do this.</p>