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

[eluser]clintonbeattie[/eluser]
Hi,

Pagination doesn't work. Have read a few tutorials and I think this code should be okay...
The initial page shows all the results from teh database but still shows the pagination. When I click on "2" in the pagination it brings up..


Code:
404 Page Not Found

The page you requested was not found.


Controller
Code:
function index()
    {
        $data['page_title'] = "Join Tables";
        $data['description'] = "Blog";
        $data['keywords'] = "Blog";
        
        
        

        $config['base_url'] = base_url();
        $config['total_rows'] = $this->db->count_all('posts');
        $config['per_page']= 2;
        $config['full_tag_open'] = '<p>';
        $config['full_tag_close'] = '</p>';
        $this->pagination->initialize($config);
        $data['paging_links'] = $this->pagination->create_links();
        
         //load the model and get results

        $data['blogposts'] = $this->MBlog->getAllPosts($config['per_page'],$this->uri->segment(3));
        
        $data['main'] = 'blog';
        $this->load->vars($data);
        $this->load->view('template');
    }

View
Code:
&lt;?php
foreach ($blogposts as $key => $post){
    echo "<h4>".$post['post_title']."</h4>";
    echo "<p>".date('d M Y', strtotime($post['post_date'])) ."</p>";
    echo "<p>".$post['post_intro']."</p>";
    
    echo anchor('welcome/post/'.$post['id'],'Read More');

}
?&gt;

&lt;?php echo $this->pagination->create_links(); ?&gt;


Messages In This Thread
Pagination 404 - by El Forum - 03-22-2009, 05:54 AM
Pagination 404 - by El Forum - 03-22-2009, 06:04 AM
Pagination 404 - by El Forum - 03-22-2009, 06:30 AM
Pagination 404 - by El Forum - 03-22-2009, 07:00 AM
Pagination 404 - by El Forum - 03-22-2009, 10:47 AM
Pagination 404 - by El Forum - 03-22-2009, 10:54 AM
Pagination 404 - by El Forum - 03-22-2009, 11:25 AM
Pagination 404 - by El Forum - 03-26-2009, 05:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB