title: I want something like facebook status update in Ajax with pagination using codeigniter
body: <p>Here is my controller "Control"</p>
  
  <pre><code>public function home()
  {
  $config = array();
  $config["base_url"] = base_url().'control/index';
  $config["total_rows"] = $this-&gt;pagin_db-&gt;record_count();
  $config["per_page"] = 10;
  $config["uri_segment"] = 3;
  
  $this-&gt;pagination-&gt;initialize($config);
  
  $page = ($this-&gt;uri-&gt;segment(3)) ? $this-&gt;uri-&gt;segment(3) : 0;
  $data["results"] = $this-&gt;pagin_db-&gt;
  fetch_countries($config["per_page"], $page);
  $data["links"] = $this-&gt;pagination-&gt;create_links();
  
  $this-&gt;load-&gt;view('header');
  $this-&gt;load-&gt;view('slr');
  $this-&gt;load-&gt;view('index', $data);
  $this-&gt;load-&gt;view('footer');
  }
  </code></pre>
  
  <p>Here is my model pagin_db</p>
  
  <pre><code>class Pagin_db extends CI_Model
  {
      public function __construct() {
          parent::__construct();
      }
  
      public function record_count() {
          return $this-&gt;db-&gt;count_all("searchf");
      }
  
      public function fetch_location($limit, $start) {
          $this-&gt;db-&gt;limit($limit, $start);
          $query = $this-&gt;db-&gt;get("searchf");
  
          if ($query-&gt;num_rows() &gt; 0) {
              foreach ($query-&gt;result() as $row) {
                  $data[] = $row;
              }
              return $data;
          }
          return false;
     }
  </code></pre>
  
  <p>Here is my view "index"</p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;center&gt;
  &lt;div id="content"&gt;
     &lt;div&gt;
    &lt;h1&gt;Countries&lt;/h1&gt;
    &lt;div id="body"&gt;
      &lt;table&gt;
  &lt;?php
  foreach($results as $data) {
      echo "&lt;tr&gt;&lt;td&gt;".$data-&gt;sno."&lt;/td&gt;&lt;td&gt;".$data-&gt;location."&lt;/td&gt;&lt;/tr&gt;";
  }
  ?&gt;
  &lt;/table&gt;
     &lt;p&gt;&lt;?php echo $links; ?&gt;&lt;/p&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  &lt;/center&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>After this what i have to do for adding ajax and the last posted city to be posted at first as like fb update</p>
  
  <p>and dont worry the city is only upto 6 in database so only it is visible like that</p>