Last active
June 4, 2017 07:50
-
-
Save rintoug/c23aa3336764b9c9723b06413c48bc86 to your computer and use it in GitHub Desktop.
How to do Pagination in CodeIgniter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Country_model extends CI_Model { | |
public function __construct() | |
{ | |
parent::__construct(); | |
} | |
public function total_rows() | |
{ | |
return $this->db->count_all("apps_countries"); | |
} | |
public function get_countries($limit, $start) | |
{ | |
$this->db->limit($limit, $start); | |
$query = $this->db->get("apps_countries"); | |
if ($query->num_rows() > 0) { | |
return $query->result_array(); | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment