title: Pagination with Codeigniter
body: <p>I'm using Codeigniter..and i'm new to this. What i'm trying to do is to use pagination in my code but the problem is the pagination link is not shown at the bottom.</p>
  
  <p><strong>My Controller:</strong></p>
  
  <pre><code>public function dsbds() 
          {    
               $this-&gt;load-&gt;library('pagination');
               $this-&gt;load-&gt;model('admin_model');
               $result_per_page = 1;  // the number of result per page
               $config['base_url'] = base_url() . '/admin/';
               $config['total_rows'] = $this-&gt;admin_model-&gt;dsbds();
               $config['per_page'] = $result_per_page;
               $this-&gt;pagination-&gt;initialize($config);
  
               $datatable = $this-&gt;admin_model-&gt;dsbds($result_per_page, $this-&gt;uri-&gt;segment(3));
               $this-&gt;load-&gt;view('admin/danhsachbds', array(
                  'bds' =&gt; $datatable,
                  'result_per_page' =&gt; $result_per_page
              ));
  
  
          }
  </code></pre>
  
  <p><strong>My Model:</strong></p>
  
  <pre><code>public function dsbds($limit, $offset)
          {
          $this-&gt;db-&gt;limit($limit, $offset);
          $q = $this-&gt;db-&gt;query("SELECT bds.id, duan.tenduan, loaibds.loai, bds.tieude, phongngu.phongngu, phongtam.phongtam, viewbds.view, huongbds.huong, noithat.noithat, bds.dientich, bds.gia, donvibds.donvi, bds.noidung, duan.slugda, bds.slugbds, bds.datecreate, bds.dateupdate FROM bds LEFT JOIN duan ON duan.id=bds.tenduan LEFT JOIN loaibds ON loaibds.id=bds.loai LEFT JOIN phongngu ON phongngu.id=bds.phongngu LEFT JOIN phongtam ON phongtam.id=bds.phongtam LEFT JOIN viewbds ON viewbds.id=bds.view LEFT JOIN huongbds ON huongbds.id=bds.huong LEFT JOIN noithat ON noithat.id=bds.noithat LEFT JOIN donvibds ON donvibds.id=bds.donvi ORDER BY bds.id DESC");
  
               if($q-&gt;num_rows() &gt; 0)
                   return $q-&gt;result();
               return false;
          }
  </code></pre>
  
  <p><strong>My View:</strong></p>
  
  <pre><code>    &lt;table&gt;
  
       &lt;tbody&gt;
  
        &lt;?php foreach($bds as $d) { ?&gt;
          &lt;tr&gt;
          &lt;td&gt;&lt;?php echo $d-&gt;id; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $d-&gt;tenduan; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $d-&gt;phongngu; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $d-&gt;phongtam; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $d-&gt;dientich; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $d-&gt;noithat; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $d-&gt;gia; ?&gt; &lt;?php echo $d-&gt;donvi; ?&gt;&lt;/td&gt;          
          &lt;td&gt;&lt;button type="button" class="btn btn-success btn-sm"&gt;Edit&lt;/button&gt; &lt;/td&gt;
           &lt;/tr&gt;
                          &lt;?php } ?&gt;   
    &lt;/tbody&gt;
      &lt;?php echo $this-&gt;pagination-&gt;create_links();  ?&gt;
    &lt;/table&gt;
  </code></pre>
  
  <p>My Error:</p>
  
  <p>Severity: Warning
  Message: Missing argument 1 for Admin_Model::dsbds(), called in /application/controllers/admin.php on line 231 and defined
  Filename: models/admin_model.php</p>
  
  <p>Severity: Warning
  Message: Missing argument 2 for Admin_Model::dsbds(), called in /application/controllers/admin.php on line 231 and defined
  Filename: models/admin_model.php</p>
  
  <p>A PHP Error was encountered
  Severity: Notice
  Message: Undefined variable: limit
  Filename: models/admin_model.php
  Line Number: 316</p>
  
  <p>A PHP Error was encountered
  Severity: Notice
  Message: Undefined variable: offset
  Filename: models/admin_model.php
  Line Number: 316</p>
  
  <p><strong>Fatal error: Unsupported operand types in /code/system/libraries/Pagination.php on line 124</strong></p>