pagination didn't work

#21
[eluser]mah0001[/eluser]
If you are getting the same db rows on every page, it might be that you have a bug in your furom model. Could you post the code for the furom->furomcontent method?

Code:
$furomcontent['data'] = $this->furom->furomcontent($config['per_page'], $config['uri_segment']);

#22
[eluser]marjune[/eluser]
Code:
function furomcontent($perpage, $offset){
              
               $sql = "SELECT a.fname, a.lname, topic_id, topic, views, lpost,
                          (SELECT COUNT(topic2.topic_id)
                          FROM furom_reply AS topic2
                          WHERE topic2.topic_id = forum_topic.topic_id)
                          AS countreply
                      FROM account a JOIN forum_topic ON a.acc_id = forum_topic.acc_id
                      ORDER BY topic_id DESC
                      LIMIT $offset, $perpage";
               $query = $this->db->query($sql);
               return $query->result();
                  
}

#23
[eluser]mah0001[/eluser]
Can't you see the problem now? change the code to:

Code:
//old code
$furomcontent['data'] = $this->furom->furomcontent($config['per_page'], $config['uri_segment']);

//change
$furomcontent['data'] = $this->furom->furomcontent($config['per_page'], $this->uri->segment(3));

$config['uri_segment'] is set to a fixed value of 3, you need to use the uri-segment function

#24
[eluser]marjune[/eluser]
got it thanks!!!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.