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

[eluser]_just_me[/eluser]
Hello,

I'm having an issue with pagination in that the links are not displayed. The problem occurred as soon as I added the $num and $offset vars into the model, I'm guessing that my syntax is incorrect and would appreciate it if someone glances their eye over it and can't point me in the right direction.

The model in question is:
Quote: function getAllMusic($num,$offset){
$this->db->select('ae_music.*, ae_genres.*, ae_users.*, ae_locations.*');
$this->db->from('ae_music', 'ae_genres', 'users');
$this->db->join('ae_users', 'ae_users.id = ae_music.user_id');
$this->db->join('ae_genres', 'ae_genres.genre_id = ae_music.genre_id');
$this->db->join('ae_locations', 'ae_locations.location_id = ae_music.location_id');
$this->db->order_by('music_id', 'DESC');
$this->db->limit($num,$offset);
$q = $this->db->get();
if($q->num_rows() > 0) {
foreach($q->result() as $getAllMusicRow) {
$data[] = $getAllMusicRow;
}

return $data;
}
else {
return FALSE;
}
}

It works fine in displaying all records and the pagination links without this line:
Code:
$this->db->limit($num,$offset);
Thanks!

_just_me


Messages In This Thread
Pagination error in CI - by El Forum - 04-03-2011, 08:00 AM
Pagination error in CI - by El Forum - 04-03-2011, 08:22 AM
Pagination error in CI - by El Forum - 04-03-2011, 08:51 AM
Pagination error in CI - by El Forum - 04-03-2011, 10:29 AM
Pagination error in CI - by El Forum - 04-03-2011, 11:04 AM
Pagination error in CI - by El Forum - 04-03-2011, 01:45 PM
Pagination error in CI - by El Forum - 04-03-2011, 02:59 PM
Pagination error in CI - by El Forum - 04-03-2011, 07:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB