how to paginate in codginator

i m trying to do simple pagination but can't doing it properly.
there isn't any result of my codes
they are asit is simple


want pagination type of this

<first>123456<last>
plz can any body sujjest me the right code.
its simply urgent.

thanks.
pagination.php
bhoj pandeyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
There are many examples online showing how it can be done.  CodeIgniter is fairly "mature" so there may be release-dependent issues - choose the examples that are applicable to the release you're using.

These are from respected sources:
http://www.codeigniter.com/userguide3/libraries/pagination.html
https://ellislab.com/codeigniter/user-guide/libraries/pagination.html
http://www.sitepoint.com/pagination-with-codeigniter/

Going forward, you may want to learn about Laravel.  Much, much better than CodeIgniter!
Ahmed MerghaniSoftware EngineerCommented:
Your code is missing 2 things:
1- You need to fetch the data as pages also not all data.
$query = $this->db->get('mytable', 10, 20);

Open in new window

2- Get the offset and the items per page to pass it to the model:
showAllData($offset, $items_per_page)

See the attached file.
pagination.php
Ahmed MerghaniSoftware EngineerCommented:
Also you need a function to get the number of records in the table. Find updated version.
pagination.php

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

bhoj pandeyAuthor Commented:
thank you sir

which thing i do.
 I see all that in ci user guide
but they didn't mention those things which u guide me.

& now it it is woking perfectly

beside
in my city there isn't any one
who guide me that where i m wrong.


Thanks soo much.
bhoj pandeyAuthor Commented:
Thanks
Ahmed MerghaniSoftware EngineerCommented:
You are welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.