load data dynamically on page scroll using jquery ajax and php

Today, We want to share with you load data dynamically on page scroll using jquery ajax and php.In this post we will show you load data dynamically on page scroll using jquery ajax and mvc, hear for Load data dynamically on page scrolling using jQuery, Ajax, PHP, and MySQL we will give you demo and example for implement.In this post, we will learn about Data Auto Load While Scrolling Page Down With Jquery PHP And MySQL with an example.

Load Dynamic Data on Page Scroll using jquery AJAX in PHP MYSQL

  • db.php (database configuration file)
  • index.php (main UI file)
  • get-data.php (fetch data from database)
  • bootstrap folder (CSS and js)

Step 1: Database Configuration (db.php)


Include Bootstrap Files (index.php)

step 2:




HTML – Display Data (index.php)

Step 3:

  
  
load data dynamically on page scroll using jquery ajax and php

jQuery and Ajax – Load Data Dynamically (index.php)

step 4:


PHP And MySQL – Fetch Data From Database (get-data.php)

step 5:


total_rows/$limit);
$query  = "select * from `posts` limit $offset, $limit";
$res = mysqli_query($con, $query);
if(mysqli_num_rows($res) > 0) {
  $outputs = "";
  $outputs .= '';
  $outputs .= '';
  $outputs .= '
'; while($row = mysqli_fetch_object($res)) { $outputs .= '

'.$row->title.'

'; $outputs .= '

' . $row->content . '

'; } $outputs .= '
'; echo $outputs; } ?>

I hope you get an idea about load content on scroll down jquery ajax.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment