Pagination problem : Only even page number - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Pagination problem : Only even page number (/showthread.php?tid=11281) |
Pagination problem : Only even page number - El Forum - 09-02-2008 [eluser]anggie[/eluser] I don't know about this, but my pagination links always navigate to even numbers only (0, 2, 4, etc.) I have checked my config but i'm sure I do everything right way. Could you help me? Thanks in advance. Pagination problem : Only even page number - El Forum - 09-02-2008 [eluser]anggie[/eluser] This is my 'simplified' controller : Code: <? Come on...help me please... Pagination problem : Only even page number - El Forum - 09-02-2008 [eluser]anggie[/eluser] Just information, if I change $config['per_page'] to 1, everything goes OK... Pagination problem : Only even page number - El Forum - 09-02-2008 [eluser]anggie[/eluser] I more confused now... If I change per_page to 3, now not even number,but odd number! &#^*@$^@&$^@*$&...........................&*&*($&@(*&@!$( Pagination problem : Only even page number - El Forum - 09-02-2008 [eluser]coldautumn[/eluser] $limit=$this->uri->segment(3); if($limit==''){ $limit=1; } $limit=($limit-1)*2; $data['query']= $this->db->get('posting',2,$limit); Why are you doing this, this is causing the display to be even or odd. If uri->segment(3) is empty set 0.Send only $config['per_page'] & uri->segment(3) values to function or get query, where result is generated. Hope this might solve it. Pagination problem : Only even page number - El Forum - 09-02-2008 [eluser]anggie[/eluser] [quote author="coldautumn" date="1220421104"] $limit=$this->uri->segment(3); if($limit==''){ $limit=1; } $limit=($limit-1)*2; $data['query']= $this->db->get('posting',2,$limit); Why are you doing this, this is causing the display to be even or odd. If uri->segment(3) is empty set 0.Send only $config['per_page'] & uri->segment(3) values to function or get query, where result is generated. Hope this might solve it.[/quote] Thanks before. But I cannot understand your answer. I do that for my query (for page offset)...If you don't mind, could you give me your example using pagination class? Pagination problem : Only even page number - El Forum - 09-02-2008 [eluser]anggie[/eluser] Wohooo... Sorryyy.... I just realized 'THAT'. I just don't understand HOW THE SYSTEM WORKS!NOW I do! Now I know why there so less of respect with my question... Pagination problem : Only even page number - El Forum - 09-03-2008 [eluser]Sumon[/eluser] Have a look http://ellislab.com/forums/viewthread/89891/#453829 |