开发者

Simple AJAX MySQL Query Load

I've asked this in a different post but finally realized what it is I'm actually trying to ask.

Is there anything simple that will allow me to load 5 rows from a MySQL table and then with an AJAX drive开发者_JAVA技巧n button, show 5 more, etc, etc (sorta like Facebook does with their 'View Older Posts' button (I am using PHP).


You can retrieve all of your data and store in DIVs, placing 5 records in every div and separating divs by id and then use javascript to show div on each click.


Create a JS var that stores your current record status.

Every time you load the 5 records, pass this value through ajax to your script to use in the MySQL "LIMIT $start, 5 "portion. Everytime you load, increment the variable by 5 and pass it back to your PHP page. It'll grab the next five, limiting 5 records.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜