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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:48:48+00:00 2026-05-19T15:48:48+00:00

I have a file where I am showing two different reports. So these two

  • 0

I have a file where I am showing two different reports. So these two different reports needs two different pagination scripts. I have done this. Pagination is working fine. But i have some issue.
1-When I clicks on 3rd page of 1st report it goes on 3rd page. But when I click on any page of second report the first report again comes to 1st page and vice versa.
I am setting different variables of limit, offset, no of records, no of pages for both scripts.
Here is the script for first script

$limit1=10;
//nor is method that return total number of rows
$nor1=nor("select count(*) as num from order_details where artist_id=".$_SESSION["sess_artistid"]);
if( isset($_GET['pn1']) && $_GET['pn1']-0>0)
$pn1=$_GET['pn1'];
else
$pn1=1;
$nop1=ceil($nor1 / $limit1);
if($pn1>$nop1)
$pn1=1;
$offset1=($pn1-1) * $limit1; 

then I query to table and shows record. and here I am showing pagination for first script

for($i=1;$i<=$nop1;$i++)
{
 if($i==$_GET['pn1'])
 echo('<a style="font-weight:bold;">'.$i.'</a>');
 else
 echo('<a href="'.$_SERVER['PHP_SELF'].'?pn1='.$i.'">'.$i.'</a>');
}

Now for second report I am using the following code snipt

$limit=7;
$nor=nor("select count(*) as num from order_details where product_id in(".implode(',',$products).") and artist_id in(".implode(',',$vendors).")");
if( isset($_GET['pn']) && $_GET['pn']-0>0)
$pn=$_GET['pn'];
else
$pn=1;
$nop=ceil($nor / $limit);
if($pn>$nop)
$pn=1;
$offset=($pn-1) * $limit;

Then again query to table to show record and here showing pagination for second report

for($i=1;$i<=$nop;$i++)
{
if($i==$_GET['pn'])
echo('<a style="font-weight:bold;">'.$i.'</a>');
else
echo('<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a>');
}

As for as I am understanding, When any of the other report is clicked it sets the first report pn=1 that’s why it goes to first page again. But not understanding how to handle this?

  • 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-19T15:48:49+00:00Added an answer on May 19, 2026 at 3:48 pm

    Add &pn=$pn to all links that currently contain ?pn1=$pn1 and vice versa.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file that I want to include in Python but the included
I have the problem that the accelerators of JMenuItems aren't working anymore after showing
I have a package with two modules in it. One is the __init__ file,
Static variable has file scope. Say I have two following files: file1.h file1.cpp file2.h
In the filesystem I have /file.aspx /directory/default.aspx I want to configure IIS so that
I have a file in the following format: Data Data Data [Start] Data I
I have Windows File sharing enabled on an OS X 10.4 computer. It's accessible
I have a file which is an XML representation of some data that is
I have a file saved as UCS-2 Little Endian I want to change the
I have a file temp.txt, that I want to sort with the sort command

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.