phpjqueryajaxpagination

How to fetch records from mysql database and display 10 results per page using Jquery Pager Plugin. Please Help


I came to know the Jquery Pager Plugin is nice. But in the demo of that plugin they used only some texts to display in the paging. But I need to display the database recordsets results in paging. I need help Any help will be appreciated


Solution

  • When a page button is clicked your

    buttonClickCallback: function(pageclickednumber) { 
    }
    

    function is called. Make an ajax request containing this pageclickednumber. Can be as simple as

    buttonClickCallback: function(pageclickednumber) { 
      $('#results').load('your/script.php?page='+pageclickednumber);
    }
    

    Your server-side script then calculates which records it must fetch and send back to the client. Something like $offset = $page*$itemsPerPage;