Welcome Guest, Not a member yet? Register   Sign In
Problem in Pagination
#1

[eluser]zombica[/eluser]
Hey guys i am doing pagination and i am unable to resolve this thing. I am getting the value of $this->uri->segment(4) for my offset but it returns nothing.

class Users extends Controller {

function Users(){

parent::Controller();
$this->load->model('usermodel');
$this->load->library('pagination');
$this->load->library('session');
$this->load->helper('url');
$this->load->helper('form');
$this->load->helper('date');
$this->load->library('validation');
$this->load->library('email');

}

function users_view(){

/// set page title
$this->data['title'] = 'View Users Records ';
$this->load->vars($this->data);

/******Paginating Records********/
$rows=$this->db->count_all("tms_user");
$base=base_url();
$config['base_url'] =base_url().$this->config->item('index_page').'/'.'users/users_view';
$config['total_rows'] = $rows;
$config['per_page'] = '5';
$config['uri_segment'] = 4;
$config['num_links'] = 4;
$config['first_link'] = '«';
$config['last_link'] = '»';
$config['next_link'] = '>';
$config['prev_link'] = '<';
$this->pagination->initialize($config);

/*******************************/
$data=$this->load_leftmenu();
$user_id = $_SESSION['user_id'];
$data['alluserList'] = $this->usermodel->get_all_user($config['per_page'],$this->uri->segment(4),$user_id); //
$this->load->view('users_view',$data);
exit;
}


A Database Error Occurred

SELECT * from tms_user where userId <> 1 and deleted='0' order by username LIMIT 5,


Regards,
Thanx in advance.....


Messages In This Thread
Problem in Pagination - by El Forum - 06-26-2009, 12:08 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:18 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:20 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:25 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:26 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:28 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:33 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:48 AM
Problem in Pagination - by El Forum - 06-26-2009, 12:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB