title: I am getting Unsupported operand types error in codeigniter
body: <p>When I try to add pagination links, I am getting <strong>Unsupported operand types error</strong></p>
  
  <p>Here is my code </p>
  
  <h2>Model</h2>
  
  <pre><code>public function getCategory($limit,$offset){
  
      $this-&gt;db-&gt;select("*");
      $this-&gt;db-&gt;from("tbl_category");
      $this-&gt;db-&gt;limit($limit,$offset);
  
      $row = $this-&gt;db-&gt;get()-&gt;result_array();
  
      return $row;
  }
  
  public function num_rows(){
      $this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;from('tbl_category');
      $row = $this-&gt;db-&gt;get()-&gt;result_array();
      return $row;
  }
  </code></pre>
  
  <h2>controller</h2>
  
  <pre><code>public function category($script="list",$id=""){
      $data['script'] = $script;
  
      if($script == 'list'){
  
          $config = [
              'base_url' =&gt; base_url('http://localhost/training/admin/'),
              'per_page' =&gt; 2,
              'total_rows' =&gt; $this-&gt;admin_model-&gt;num_rows(),
          ];
          $this-&gt;pagination-&gt;initialize($config);
          $rows = $this-&gt;admin_model-&gt;getCategory($config['per_page'], $this-&gt;uri-&gt;segment(3));
          $data['rows'] = $rows;
      }
  </code></pre>
  
  <p>In my View file I do this to get links</p>
  
  <pre><code>&lt;?php $this-&gt;pagination-&gt;create_links(); ?&gt;
  </code></pre>
  
  <h2>The error I get is like below</h2>
  
  <p>An uncaught Exception was encountered
  Type: Error</p>
  
  <p>Message: Unsupported operand types</p>
  
  <p>Filename: C:\xampp\htdocs\training\system\libraries\Pagination.php</p>
  
  <p>Line Number: 412</p>
  
  <p>Backtrace:</p>
  
  <p>File: C:\xampp\htdocs\training\application\views\category.php
  Line: 101
  Function: create_links</p>
  
  <p>File: C:\xampp\htdocs\training\application\controllers\Admin.php
  Line: 150
  Function: view</p>
  
  <p>File: C:\xampp\htdocs\training\index.php
  Line: 315
  Function: require_once</p>