Advanced jQuery Ajax Pagination PHP MySQL using jQuery

Advanced jQuery Ajax Pagination PHP MySQL using jQuery

In this Post We Will Explain About is Advanced jQuery Ajax Pagination PHP MySQL using jQuery With Example and Demo.

Also you can read my previous Articles Like pagination in php demo, dynamic pagination in php with mysql example, pagination code in php with next and previous demo

Welcome on – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to simple pagination code in php with example

In this post we will show you Best way to implement simple pagination in php with mysql example demo, hear for How to How to create pagination in PHP and MySQL with AJAX with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Pagination with Jquery PHP Ajax and MySQL

Using Simple PHP, we will display the all the Comments from the MySQL simple database with the simple PHP pagination ul or li links. so this simple pagination all the li links, we can get simple the database records except the all displayed records. using jQuery and Ajax call will help to simple get the PHP records from the Mysql database simple depending on all the Ul or li pagination links simple without reloading any PHP the page.

There are all the following files and simple folder will participate on simple pagination code in php with demo and mysql


	message VARCHAR(150)

JavaScript Code

<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">

	function loading_show()
		$('#page_loader').html("<img src='images/page_loader.gif'/>").fadeIn('fast');

	function loading_hide()

	function loadData(live_page)
			type: "POST",
			url: "load_data.php",
			data: "live_page="+live_page,
			success: function(msg)
				$("#page_live").ajaxComplete(function(event, request, settings)
		$('#page_live .pagination').live('click',function(){
		var live_page = $(this).attr('p');


	$live_page = $_POST['live_page'];
	$cur_page = $live_page;
	$live_page -= 1;
	$total_per_page = 10; 
	$previous_btn = true;
	$next = true;
	$first_btn = true;
	$last_btn = true;
	$start = $live_page * $total_per_page;
	$query_pag_data = "SELECT msg_id,message from comments LIMIT $start, $total_per_page";
	$result_pag_data = mysqli_query($query_pag_data);
	$msg = "";
	while ($row = mysqli_fetch_array($result_pag_data,MYSQLI_ASSOC)) 
		$msg .= "<li><b>" . $row['msg_id'] . "</b> " . $htmlmsg . "</li>";

	$msg = "<div class='data'><ul>" . $msg . "</ul></div>"; 

	$query_pag_num = "SELECT COUNT(*) AS count FROM comments"; 
	$total_pageno = mysqli_query($query_pag_num);
	$row = mysqli_fetch_array($total_pageno,MYSQLI_ASSOC);
	$count = $row['count'];
	$no_of_paginations = ceil($count / $total_per_page);


define('DB_SERVER', '');
define('DB_USERNAME', 'atmiya25');
define('DB_PASSWORD', '[email protected]$%85');
define('DB_DATABASE', 'database');


I hope you have Got Pagination with jQuery Ajax PHP and MySQL And how it works.I would Like to have FeadBack From My Blog( readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article( Are Most Always Welcome.

Related FAQ

Here are some more FAQ related to this Article:

  1.   MySQL BETWEEN Operators with WHERE Condition
  2.   Simple PHP Pagination Example Tutorial
  3.   pagination code in php with next and previous demo
  4.   PHP - Save base64 Encoded string - Convert base64 to Image
  5.   Download Sample woocommerce products Data in CSV
  6.   Advanced Pagination with PHP, MySQL and jQuery Demo
  7.   Clone Specific Git Branch from Remote Repository
  8.   Ng-Bind Directive using Angular Example
  9.   how to add edit and delete rows of a html table with javascript?
  10.   File upload and sending data to backend using angular js