开发者

PHP paging with jquery and ajax

Anyone know how to do paging with php. like this:

First 1 2 3 4 5 6 7 ... 10 11 12 Next Last.

10 15 20 per page.

is it possible to do that with jq开发者_Go百科uery and ajax? Thanks for any help.

Good luck.


you may be interested in this: www.datatables.net

It's a plugin for jquery wich provides easy server side paging options.


Welcome to Stack Overflow

yes this is possible.

see http://www.google.com/search?client=ubuntu&channel=fs&q=php+jquery+paging+howto&ie=utf-8&oe=utf-8

if you want to know something specific see JohnP comment and provide more details and/or specific questions.


Anyone know how to do paging with php

Same as any other language. You figure out how many pages you have, and you have something in the URI to tell you what page to fetch. When the link is followed, you get the page number from it, and use that to calculate an offset for fetching data from your model.

The specifics depend on how the data is stored.

is it possible to do that with jquery and ajax?

You need the above foundation in place. You could then build on it with pushState and ajax to replace part of the page - but it usually isn't worth the effort for things that require paging.


Yes, of course it is possible. Here are two tutorials (I found from Google) about Pagination with PHP and jQuery.

http://blarnee.com/wp/how-to-create-a-simple-pagination-system-using-jquery-php-and-mysql/

And

http://www.9lessons.info/2009/09/pagination-with-jquery-mysql-and-php.html

Hope it helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜