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 6657085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:43:25+00:00 2026-05-26T01:43:25+00:00

I am using AJAX Pagination for displaying my records in application from MySQL using

  • 0

I am using AJAX Pagination for displaying my records in application from MySQL using PHP.
I have done that successfully but just need one solution:

I need to display a Serial No while displaying records like:

----------------------------
S.No   Name       Country  
----------------------------
1      Sandeep    India  
2      Rahul      Japan  
3      Riya       China   
4      Sohan      India  
...
50     James      USA

If I have set to show 20 results per page while paginating the first page shows serial no. 1 to 20 , 2nd page shows serial no 1 to 20 and 3rd page shows serial no 1 to 10.

But I want to show serial no. 1 – 20 in first page , 21- 40 in second page , 41- 50 in 3rd page.

How can I do this in PHP?

Here is my code:

$ssql = $ssql_select.$ssql_where." order by reg_date desc LIMIT $Page_Start , $Per_Page";
$rs=mysql_query($ssql, $cn) or die("MySQL error: ".mysql_error());
$ctr = 1;
while ($row = mysql_fetch_object($rs)) {

    echo "<td align=center>".$ctr."</td>";
    echo "<td align=center>".$row->name."</td>";
    echo "<td align=center>".$row->country."</td>";
    $ctr++;
}
  • 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-05-26T01:43:25+00:00Added an answer on May 26, 2026 at 1:43 am

    Try

     ...
        while ($row = mysql_fetch_object($rs)) {
    
            echo "<td align=center>" . $ctr + $Page_Start . "</td>";
            echo "<td align=center>".$row->name."</td>";
            echo "<td align=center>".$row->country."</td>";
            $ctr++;
        }
     ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I developed a simple jquery ajax php application. I done a pagination. In that
I have already implemented some AJAX pagination in my Rails app by using the
I have started using ajax/jQuery in our websites / application. There are many plugins
How do I preview a url using ajax? I have seen this done with
I am using an AJAX pagination and that is working fine. It returns the
Using ajax how to get response from the server servlet as xml that contains
I am using Ajax tab container control with 3 tabs. I have placed a
when i using ajax control but control tick every 1 secound and when i
I am using AJAX modal popup in my project, but there is problem with
I am using php mysql. First on form submission I run query on mysql

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.