title: codeIgniter pagination- doesn't go to the next link of searched results
body: <p>I am using pagination for searched results. Searching is working perfectly. The first 10 records are shown after the search. But when I click the next button everything disappears and an empty page is displayed.</p>
  
  <p>Any ideas what might be wrong in my code would be appreciated. </p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>function search_bookings($time, $title, $payment, $start_date, $end_date,$limit, $start, $type) {
  
          $this-&gt;db-&gt;select('reservations.*');
          $this-&gt;db-&gt;from('reservations');
          $this-&gt;db-&gt;where('is_deleted', '0');
          $this-&gt;db-&gt;order_by('date_cal',"desc");
  
           if (!empty($time) &amp;&amp; !is_null($time)) {
              $this-&gt;db-&gt;where('reservations.type', $time);
          }
          if (!empty($payment) &amp;&amp; !is_null($payment)) {
              $this-&gt;db-&gt;where('reservations.advanced_payment_status', $payment);
          }
  
          if (!empty($title) &amp;&amp; !is_null($title)) {
              $this-&gt;db-&gt;where('reservations.title', $title);
          }
  
          if (!empty($start_date) &amp;&amp; !is_null($start_date)) {
              $this-&gt;db-&gt;where('reservations.date_cal &gt;=', $start_date);
              $this-&gt;db-&gt;where('reservations.date_cal &lt;=', $end_date);
          }
  
           if ($type == 'half') {
              $this-&gt;db-&gt;limit($limit, $start);
          }
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;result();
      }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code> function search_reservations($start = 0) {
          $reservation_service = new Reservation_service();
          $config = array();
  
          $config["base_url"] = site_url() . "/dashboard/manage_bookings/";
          $config["per_page"] = 10;
          $config["uri_segment"] = 4;
          $config["num_links"] = 4;
  
          $time = $this-&gt;input-&gt;post('type', TRUE);
          $title = $this-&gt;input-&gt;post('title', TRUE);
          $payment = $this-&gt;input-&gt;post('payment', TRUE);
          $date_from = $this-&gt;input-&gt;post('date_from', TRUE);
          $date_to = $this-&gt;input-&gt;post('date_to', TRUE);
          $searched_results = $reservation_service-&gt;search_bookings($time, $title, $payment, $date_from, $date_to, $config["per_page"], $start, 'half');
          $data['search_results'] = $searched_results;
          $config["total_rows"] = count($reservation_service-&gt;search_bookings($time, $title, $payment, $date_from, $date_to, $config["per_page"], 0, 'all'));
          $this-&gt;pagination-&gt;initialize($config);
  
          $data["links"] = $this-&gt;pagination-&gt;create_links();
  
          $this-&gt;load-&gt;view('body_pages/search_results', $data);
      }
  </code></pre>
  
  <p><strong>Search results view</strong></p>
  
  <pre><code>&lt;table  class="display table table-bordered table-striped" id="bookings_table"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;#&lt;/th&gt;
              &lt;th&gt;Date&lt;/th&gt;
              &lt;th&gt;Hall&lt;/th&gt;
              &lt;th&gt;Time&lt;/th&gt;                               
              &lt;th&gt;Actions&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;?php
          $i = 0;
          foreach ($search_results as $result) {
              ?&gt;
              &lt;tr id="bookings_&lt;?php echo $result-&gt;id; ?&gt;"&gt;
                  &lt;td&gt;&lt;?php echo ++$i; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $result-&gt;date_cal; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php if ("RP" == $result-&gt;title) { ?&gt;&lt;?php
                          echo "Royal Princess Ballroom (Downstairs)";
                      }
                      ?&gt;
                      &lt;?php if ("GK" == $result-&gt;title) { ?&gt;&lt;?php
                          echo "Grand Kings Ballroom (Upstairs)";
                      }
                      ?&gt;
                  &lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $result-&gt;type; ?&gt;&lt;/td&gt;  
                  &lt;td align="center"&gt;    
                      &lt;a class="btn btn-primary btn-xs" onclick="display_edit_reservation_pop_up(&lt;?php echo $result-&gt;id; ?&gt;)"&gt;&lt;i class="fa fa-pencil"  title="Update"&gt;&lt;/i&gt;&lt;/a&gt;
                      &lt;a class="btn btn-danger btn-xs" onclick="delete_bookings(&lt;?php echo $result-&gt;id; ?&gt;)" &gt;&lt;i class="fa fa-trash-o " title="Remove"&gt;&lt;/i&gt;&lt;/a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;?php } ?&gt;
  
      &lt;/tbody&gt;
  
  &lt;/table&gt;
  
  &lt;div class="pagination"&gt;
      &lt;?php echo $links; ?&gt;
  &lt;/div&gt;                                          
  </code></pre>