Pagination doesnt appear |
[eluser]Balistix[/eluser]
Hi there, I am very much new to php and code igniter itself. Recently I followed some tutorials on pagination, but it doesn't work as it should. I suspect its probably my coding error (most proobably) , can anyone be helpful enough to check this up for me. Thanks. My controller Code: <?php This is my view for testing purpose Code: <div id="container"> This is how it turns out. [Image: http://img138.imageshack.us/img138/4275/testjo.png] Alternatively I tried this after seeing one of the thread. Code: <?php I heard it might be the base url problem, but again, only the pagination part does not appear. Hopefully someone can help me understand what is the problem. Thanks in advance.
[eluser]Balistix[/eluser]
Thanks for your reply, im watching it now, hopefully it helps. If it matters, im using xampp, on windows machine with not .httacces.
[eluser]InsiteFX[/eluser]
I am running XAMPP 1.7.3 Windows Vista PHP 5.3.1 with no .htaccess You may need the following: $config['uri_segment'] = 3; The 3 will be your last uri segment number. InsiteFX
[eluser]Balistix[/eluser]
Tried and doesnt work. I actually followed the coding style of Jeffrey Way without changing any important part, so im stumped at why mine does not work only at the pagination part. Where I did not change anything to the code. Pagination Screencast Just finished streaming all the screencast you gave me yesterday when I woke up this morning. Going to have a look soon.
[eluser]pickupman[/eluser]
It looks like you maybe passing false to your query since the 3rd uri segment may not be set. Change Code: $data['records'] = $this->db->get('ci_images', $config['per_page'], $this->uri->segment(3)); To: Code: $data['records'] = $this->db->get('ci_images', $config['per_page'], $this->uri->segment(3,0)); This will pass an offset of 0 if the 3rd segment is not present
[eluser]Balistix[/eluser]
But that $data['records'] query is for generating table not pagination. But I'll try your method. edited : tried, doesnt work ![]()
[eluser]pickupman[/eluser]
You also need to change: Code: $config['total_row'] = $this->db->get('ci_images')->num_rows(); To Code: $config['total_rows'] = $this->db->get('ci_images')->num_rows(); You were missing the "s" in total_rows. You also need the part I posted above, otherwise you are never passing an offset to start from.
[eluser]Balistix[/eluser]
Oh my.. I guess i missed that out. It worked now. Thanks for your help and sorry for the time wasted on silly mistakes. |
Welcome Guest, Not a member yet? Register Sign In |