title: pagination is not working in codeigniter :(
body: <p>I want to display 2 rows in view page as an output. Again when i click on to go to the next page it will display 2 next rows and so on ( All together I have 8 rows in 
              table). But when I run the following code it displays all 8 rows in the view-page along with pagination links. I tried whole day to find the actual reason for not
              working it but my problem is still unsolved. I searched for the help on internet with related query but it was of no use. Finalyy I am here with my own words to explain
              the problem. I've commented almost all the lines in my code. I am loading libraries in autoload for pagination and helper for form and url. I'll really be thankful if
              somebody help me out. Thanks in advance.</p>
  
  <pre><code>   &lt;?php
          class ManageUser extends CI_Controller {  // creating class for the controller
              function index()
              {
                  if($this-&gt;session-&gt;userdata('logged_in'))  // checking users under session if he is already logged in
                  {           
                      $this-&gt;load-&gt;model('admin/user');     // loading model . I am not using Datamapper.
                      $result = $this-&gt;user-&gt;view_user();   // getting response from the model and storing it to result
                      $total_rows = count($result);         // counting number of rows countered ( its 8 in in my database ) 
                      //echo $total_rows;
  
  
                      if($result)
                      {
                          $data['users'] = $result;
                          $config['base_url'] = "http://192.168.0.102/project/index.php/admin/manageUser";  // this is the address where I am pointing the view page url
                          $config['total_rows'] = $total_rows;        // Total numbers of rows assigned to pagination-config
                          $config['per_page'] = '2';                  // I want to display 2 rows in 1 page
                          $config['uri_segment'] = '2';
                          $this-&gt;pagination-&gt;initialize($config);     // initilizing the pagination-config
                          //$data['pagination'] = $this-&gt;pagination-&gt;create_links();  
                          //$this-&gt;load-&gt;vars($data);
                          $this-&gt;load-&gt;view('admin/manageUser',$data);  // Loading the page
                      }
  
                      //$this-&gt;load-&gt;view('admin/manageUser',$data);
                  }
                  else
                  {
                      redirect('admin/login');    // incase of faliured session user will be redirected to the login-page.
                  }
              }
          }
          ?&gt;
  </code></pre>
  
  <p>Following code is from my model named User</p>
  
  <pre><code> &lt;?php
              Class User extends CI_Model   // extending the model
              {
                  function __construct()
                  {
                      parent::__construct();
                  }
  
                  function view_user()        // function which is loaded from controller
                  {
  
                      $query = $this -&gt; db -&gt; get('users');  //query to fetch all the information from the database
                      return $query-&gt;result();        // returning result to the Controller.
                  }
              }
          ?&gt;
  </code></pre>
  
  <p>And finally this is the view page I am using to display the content .</p>
  
  <pre><code>  &lt;!-- This is the view page --&gt;
  
          &lt;?php if(isset($users)) { ?&gt;     &lt;!-- Checking if user is set --&gt;
               &lt;?php foreach($users as $user) { ?&gt;  &lt;!-- running in a loop to accept all the value from the database and display it row wise --&gt;
                  &lt;td&gt;&lt;?php echo $user -&gt; us_display_name; ?&gt;&lt;/td&gt;   &lt;!-- Displaying name --&gt;
                  &lt;td&gt;&lt;?php echo $user -&gt; us_first_name . " " . $user -&gt; us_last_name; ?&gt;&lt;/td&gt; &lt;!-- Displaying first name and last name together --&gt;
                  &lt;td&gt;&lt;?php echo $user -&gt; us_email_id; ?&gt;&lt;/td&gt;  &lt;!-- Displaying email-ID --&gt;
          &lt;?php } } else { ?&gt;
          &lt;tr&gt;    &lt;td&gt;No records found!&lt;/td&gt;
          &lt;?php } ?&gt;
          &lt;?php echo $this-&gt;pagination-&gt;create_links(); ?&gt;
  </code></pre>