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

[eluser]weetstraw[/eluser]
When I click the link to view the next set of results, I get a 404 not found...
Code:
//Controller
function index()
{
    // Pagination
    $config['base_url']=base_url()."home/";
    $config['total_rows']=$this->db->count_all('content');
    $config['per_page']=2;
    $this->pagination->initialize($config);
    echo

    // Page Content
    $data=array(
        'result'=>$this->Home_model->getRecentPag($config['per_page'],$this->uri->segment(1)),
        'comments'=>$this->Home_model->getComments(),
        'title'=>"",
        'pagination'=>$this->pagination->create_links()
    );

    $this->load->view('home_view',$data);
}
Code:
// Model
function getRecentPag($num,$offset)
{
    $this->db->order_by('id','DESC');
    $query=$this->db->get('content',$num,$offset);

    return $query->result();
}
Code:
//Link
http://localhost/CodeIgniter/home/2

Any idea??


Messages In This Thread
Pagination Problem - by El Forum - 04-23-2009, 02:45 PM
Pagination Problem - by El Forum - 04-23-2009, 06:42 PM
Pagination Problem - by El Forum - 04-23-2009, 08:15 PM
Pagination Problem - by El Forum - 04-23-2009, 08:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB