Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8734149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:47:02+00:00 2026-06-13T09:47:02+00:00

I am currently working on a PHP mysql application which has a grid with

  • 0

I am currently working on a PHP mysql application which has a grid with a few thousand records to display.Now,the requirement doesn’t want it to be paginated in the normal way,(By displaying paging links 1,2,3 etc) but do it when user clicks on a link Show More Results. I have an anchor link,on click of which the next batch of records will be fetched from the server.The normal pagination as we all know can be achieved using the

     offset and limit parameters in a sql query
     select * from abc limit,offset;

So,in this case say my limit is “20”,but how can make the calculations for the offset that will go to the query?
I know basics of sending a ajax request on click.Something like this which would be called on click

     $.ajax({
       //request parameters and success and failure callback

     })    

Any help or guidance on this would be very helpful.
Thanks for the time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:47:03+00:00Added an answer on June 13, 2026 at 9:47 am

    hey man i am giving you an idea only:

    Consider You Have Table Links and Column Name Also Links in which there are links.

    first use php directly in your html.

    INDEX.HTML

    <html>
    <head>
    <script type="text/javascript" src="jquery.js">
    <script type="text/javascript">
    $(document).ready( function() {
    $("#more").click( function() {
    var get = document.getElementsByClassName('num');
    var numberofget = "limitnext="+get.length;
    $.ajax({
    type : "POST",
    url : "more_results.php",
    data : numberofget,
    cache : false,
    success : function(html){
    $(this).remove();
    $("#results").append(html);
    }
    });
    });
    });
    </head>
    <body>
    <div id="results">
    <?php
    
    include("db.php");
    
    $query1 = "SELECT * FROM Links LIMIT 0 , 20";
    $query2 = "SELECT * FROM Links";
    $result1 = mysql_query($query1);
    $result2 = mysql_query($query2);
    $count = mysql_num_rows($result2);
    
    while($rows=mysql_fetch_array($result1)){
    $links=$rows['links'];
    echo "<div class='num'>".$links."</div>";
    }
    
    if($count>=20){
    echo "<a id='more' href='#'>More Results of Links</a>";
    }
    
    ?>
    </div>
    </body>
    </html>
    

    more_results.php

    <?php
    
    include "db.php";
    
    $limit=$_POST['limitnext'];
    $limitaddup=$_POST['limitnext']+20;
    
    $query1 = "SELECT * FROM Links LIMIT ".$limit." , ".$limitaddup.";
    $query2 = "SELECT * FROM Links";    
    $result1 = mysql_query($query1);    
    $result2 = mysql_query($query2);
    $count = mysql_num_rows($result2);
    
    
    while($rows=mysql_fetch_array($result1)){    
    $links=$rows['links'];
    echo "<div class='num'>".$links."</div>";
    }
    
    
    if($count>=$limitaddup){    
    echo "<a id='more' href='#'>More Results of Links</a>";    
    }    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a small sponsorship application(PHP/MySql) for my personal blog, and
I'm currently working on a PHP application that uses a MySQL database for its
I'm working on a storefront application in PHP with MySQL. I'm currently storing my
I am working on a web application, which historically was built on a PHP/MySQL
I am currently working on a PHP/MySQl application. A 500 error is thrown if
I am currently working on a web application that uses PHP and MySQL, but
I am working on a web application in php mysql.Here,the requirement says,that the user
I am currently working on a PHP application that puts me in the desperate
I'm currently working on an OO PHP application. I have a class called validation
I am working with multiple databases in a PHP/MySQL application. I have development, testing,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.