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

[eluser]r@mtbb_[/eluser]
Hi,

I'm sorry to bother you with a very discussed topic but, I still can't make pagination to work on my website. Here's the code:
Code:
//controller
function index()
    {
    $config['base_url'] = 'http://localhost/website/index.php/see/';
    $config['total_rows'] = $this->db->count_all('projects');
    $config['per_page'] = 4;
    $config['uri_segment'] = 2;
    $this->pagination->initialize($config);
    
    $num     = $config['per_page'];
    $offset = $this->uri->segment(2);
    
    $this->db->orderby("date","desc");
    $data['query']= $this->db->get('projects', $num, $offset);

    $data['links']=$this->pagination->create_links();
    $this->load->view('see_view',$data);
    }
Code:
//view_file
<?php foreach($query->result() as $row): ?>
<h3>&lt;?php echo $row->title; ?&gt;</h3>
<p>&lt;?php echo $row->description; ?&gt;</p>

<hr />
&lt;?php endforeach; ?&gt;
&lt;?php echo $links; ?&gt;
When i load index.php/see , I get the correct 4 results per page, the correct numbers of links considering the total rows, but when I click a link, there's a 404 message.
The links don't have correct paths. They change along with the $config['per_page']. All the necessary libraryes and helpers are loaded. What could be the problem?
Thanks!


Messages In This Thread
Pagination once more - by El Forum - 12-31-2007, 07:36 AM
Pagination once more - by El Forum - 12-31-2007, 07:44 AM
Pagination once more - by El Forum - 12-31-2007, 08:01 AM
Pagination once more - by El Forum - 12-31-2007, 10:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB