Welcome Guest, Not a member yet? Register   Sign In
pagination prob
#1

[eluser]miss_amylee[/eluser]
hi..im newbie in CI.. i wanna ask bout pagination..there is no error displayed when i run my code.but when i click next, the page is not going to next page .. let say i have 1 2 3 > NEXT , page shud display next 2 rows data..wat i get from few forum discussed, my url shud be like

http://localhost/codeigniter/index.php/photo/index/10.

but then , wat i got from my url after i click NEXT or any number is

http://localhost/codeigniter/index.php/books/index/&per_page=5..

i think dis is d problem.. i have no idea where '&per;_page ' is come from. pls help me.. TQ

this is my controller file


<?php
class Photo extends Controller {

function __construct() {
parent::Controller();
$this->load->helper('url');
$this->load->database();
}

function index() {

//load pagination class
$this->load->library('pagination');

$config['base_url'] = base_url().'index.php/photo/index/';
$config['total_rows'] = $this->db->count_all('photo');
$config['per_page'] = '1';
$config['num_links'] = 1;
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';

$this->pagination->initialize($config);

//load the model and get results
$this->load->model('PhotoMdl');
$data['results'] = $this->PhotoMdl->loadAllPhoto($config['per_page'],$this->uri->segment(3));

// load the HTML Table Class
$this->load->library('table');
$this->table->set_heading('id','file_name', 'full_path','file_ext','raw_name');

// load the view
$this->load->view('photos', $data);
}
}
?&gt;
#2

[eluser]miss_amylee[/eluser]
finally prob solved!huhu.. i have to change my config.php file True to false



$config['enable_query_strings'] = FALSE;




Theme © iAndrew 2016 - Forum software by © MyBB