title: How to configure CodeIgniter pagination?
body: <p>Here's my code:</p>
  
  <pre><code>$config['base_url'] = base_url() . 'settings/profile/';
  $config['total_rows'] = $data['count_user_posts'];
  $config['per_page'] = 3;
  $offset = ($this-&gt;uri-&gt;segment('3') * $config['per_page']) / 2;
  $this-&gt;pagination-&gt;initialize($config);
  $config['use_page_numbers'] = True;
  $data['user_posts'] = $this-&gt;post_model-&gt;get_user_posts($_SESSION['user_id'], $config['per_page'], $config['offset']);
  </code></pre>
  
  <p>Problem is when I click on 2 or any other link, it shows some data from previous page also. Any solution - what am I doing wrong?</p>