In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-06-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to use PHP+Ajax to load more list data". In daily operation, I believe many people have doubts about how to click and load more list data with PHP+Ajax. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubt of "how to use PHP+Ajax to load more list data". Next, please follow the editor to study!
A simple and practical PHP+Ajax click to load more list data instances, the implementation principle: through the "more" button to send Ajax requests to the server, PHP paging parameter query will be the latest several records, data returned in the form of JSON, the foreground Query parses JSON data, and appends the data to the list page. In fact, it is also Ajax paging effect.
Html Code:
:: click to load more:
Introduce the jQuery plug-in and jquery.more.js to load more plug-ins:
$(function () {$('# more') .more ({'address':' data.php'})})
Data.php receives the two parameters submitted by the foreground page, $_ POST ['last'] starts the number of records, and $_ POST [' amount'] displays the number of records at a time. You can see the SQL statement, which is actually the statement used in paging.
Require_once ('connect.php'); $last = $_ POST [' last']; $amount = $_ POST ['amount']; $query = mysql_query ("select * from article order by id desc limit $last,$amount") While ($row = mysql_fetch_array ($query)) {$sayList [] = array ('title' = > ". $row [' title'].", 'author' = > $row [' id'], 'date' = > date (' row ['addtime']));} echo json_encode ($sayList) At this point, the study on "how to click and load more list data with PHP+Ajax" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.