使用Jquery / Javascript / Ajax和PHP / Mysql进行分页

时间:2022-12-05 14:03:39

Does anyone know of a link to a site that has a tutorial/code on good way to paginate information coming from a database? (without page refresh) I have spent the better part of the day looking for a site that has what I need. Most are dealing with static/fixed data in the forms of lists etc. I need one that has something like this for my tables:

有没有人知道一个网站的链接,该网站有一个教程/代码,可以很好地分析来自数据库的信息? (没有页面刷新)我花了一天的时间来寻找一个拥有我需要的网站。大多数都是以列表等形式处理静态/固定数据。我需要一个对我的表有这样的东西:

Data          Data          Data          Data          

Data          Data          Data          Data          


Records 1 to 8 of 27  First  Previous Next Last

3 个解决方案

#1


1  

We just implemented a few things using this plugin for JQuery:

我们刚刚使用这个JQuery插件实现了一些东西:

Datatables.net

Datatables.net

It works on basic html tables and has support for AJAX. Basically you would just write a PHP page that returns a partial result from your database in JSON, etc. The plugin will handle making the AJAX call and displaying the data.

它适用于基本的html表,并支持AJAX。基本上你只需编写一个PHP页面,以JSON等方式从数据库返回部分结果。该插件将处理进行AJAX调用并显示数据。

#2


0  

This is only a very partial answer (sorry, not much time atm) but look for the 'LIMIT' command in mysql. It lets you pull back only a certain set of records, say records 11-20. I use that when I do pagination.

这只是一个非常局部的答案(对不起,时间不多)但是在mysql中寻找'LIMIT'命令。它允许你只撤回一组记录,比如记录11-20。我在做分页时使用它。

Again, this isn't complete, but hopefully it'll help!

同样,这还不完整,但希望它会有所帮助!

#3


0  

I've worked with this one quite a bit. jQgrid... seems to be pretty well maintained. http://www.trirand.com/blog/

我和这个人工作了很多。 jQgrid ......似乎维护得很好。 http://www.trirand.com/blog/

#1


1  

We just implemented a few things using this plugin for JQuery:

我们刚刚使用这个JQuery插件实现了一些东西:

Datatables.net

Datatables.net

It works on basic html tables and has support for AJAX. Basically you would just write a PHP page that returns a partial result from your database in JSON, etc. The plugin will handle making the AJAX call and displaying the data.

它适用于基本的html表,并支持AJAX。基本上你只需编写一个PHP页面,以JSON等方式从数据库返回部分结果。该插件将处理进行AJAX调用并显示数据。

#2


0  

This is only a very partial answer (sorry, not much time atm) but look for the 'LIMIT' command in mysql. It lets you pull back only a certain set of records, say records 11-20. I use that when I do pagination.

这只是一个非常局部的答案(对不起,时间不多)但是在mysql中寻找'LIMIT'命令。它允许你只撤回一组记录,比如记录11-20。我在做分页时使用它。

Again, this isn't complete, but hopefully it'll help!

同样,这还不完整,但希望它会有所帮助!

#3


0  

I've worked with this one quite a bit. jQgrid... seems to be pretty well maintained. http://www.trirand.com/blog/

我和这个人工作了很多。 jQgrid ......似乎维护得很好。 http://www.trirand.com/blog/