No refresh dynamic load data scroll bar load suitable for comments and other pages _php tutorial

Source: Internet
Author: User
Scroll to load more data, suitable for comments and other pages

The database of this example is very simple and it is clear at a glance

Copy CodeThe code is as follows:


$query =mysql_query ("SELECT * from content ORDER BY id desc limit 0,10");
while ($row =mysql_fetch_array ($query)) {
?>











JS file
Copy CodeThe code is as follows:


result.php
Copy CodeThe code is as follows:
Include ("conn.php");

$page = intval ($_get[' page '); Gets the number of pages requested
$start = $page;
$query =mysql_query ("SELECT * from content ORDER BY id desc limit $start, 5");
while ($row =mysql_fetch_array ($query)) {
$arr [] = Array (
' Content ' = $row [' Message '],
' Author ' = $row [' id '],
' Date ' =>date (' m-d h:i ', Strtotime ($row [' updatetime ']))
);
}
echo Json_encode ($arr); Convert to JSON data output
?>

http://www.bkjia.com/PHPjc/824846.html www.bkjia.com true http://www.bkjia.com/PHPjc/824846.html techarticle scrolling load more data, suitable for comments and other pages The database of this example is very simple, a look at the copy code is as follows: Div id= "container"? PHP $query =mysql_query ("select * from con ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.