title: Codeigniter - reverse data in table
body: <p>I'm look for a way to display data in reverse order using the table library along with pagination in Codeigniter.  From </p>
  
  <pre><code>public function pagination(){
  
      $this-&gt;load-&gt;library("pagination");
      $this-&gt;load-&gt;library("table");
  
      $this-&gt;table-&gt;set_heading("ID", "Name", "Address");
  
      $config["base_url"] = site_url('site/pagination');
      $config["total_rows"] = $this-&gt;db-&gt;get("mail")-&gt;num_rows();
      $config["per_page"] = 10;
      $config["num_links"] = 10;
      $config['page_query_string'] = TRUE;
  
  
      $this-&gt;pagination-&gt;initialize($config);
  
      $data["records"] = $this-&gt;db-&gt;get("mail", $config["per_page"], $this-&gt;input-&gt;get('per_page', TRUE)); 
      $data['pagination'] = $this-&gt;pagination-&gt;create_links();
  
      $this-&gt;load-&gt;view("site_header");
      $this-&gt;load-&gt;view("site_nav");
      $this-&gt;load-&gt;view("content_about", $data);
      $this-&gt;load-&gt;view("site_footer");
  
  }
  </code></pre>
  
  <p>The table is working just fine but i can't figure out a way to display the data in reverse order. I would like to make the table start with the latest entries (ID, Name, Address) from the database and not the first.  </p>
  
  <p>I suppose their i something wrong with how i query the database:
  $data["records"] = $this->db->get("mail", $config["per_page"], $this->input->get('per_page', TRUE));</p>