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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:29:25+00:00 2026-06-14T13:29:25+00:00

I would like to add pagination to a page that renders dynamic data. But

  • 0

I would like to add pagination to a page that renders dynamic data. But I get the following erros when I click the page links(1,2,3, etc). I am fairly new to php, please assist.

Notice: Undefined index: Jobid in C:\wamp\www\HR\HR_Applicants.php on line 4
Notice: Undefined index: Jobid in C:\wamp\www\HR\HR_Applicants.php on line 8
Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\HR\HR_Applicants.php on line 18
Notice: Use of undefined constant mysql_error – assumed ‘mysql_error’ in C:\wamp\www\HR\HR_Applicants.php on line 28

All the errors following the error on line 4 Occurs because Jobid loses its value when I click on the pagination link(i.e 1, 2, 3, etc). Initially when the page load, it land on the normal(unpaginated page) and that works fine. Problems arises when the pagination links are clicked.

Here follows the code for the paginated page.

<?php
session_start();
print_r( $_GET, true );
print_r($_REQUEST['Jobid']);

require 'scripts/connect.php';
//Get the Person's jobid
    $jobid = $_GET['Jobid'];


//the number of rows to show per page   
$per_page = 2;

//Count the number of items in the database
$pages_query = mysql_query("SELECT COUNT('Personid') FROM person where jobid=$jobid");

//Round the number of pages to the nearest 10
$pages = ceil(mysql_result($pages_query,0) / $per_page);

//Check if there value of page is set
$page = (isset($_GET['page'])) ?(int)$_GET['page']: 1;

//Start counting from zero
$start = ($page -1)* $per_page;

//Select the data from the datbase, but limit it to the number of item per page
$Personid_query ="SELECT * FROM person where jobid=$jobid LIMIT $start ,$per_page";
$Personid = mysql_query($Personid_query) or die(mysql_error);
$row = mysql_fetch_assoc($Personid);

?>

The above code is right on top, just before the HTML tags. The following code falls within the HTML tags because the data displayed to user is dynamic and its selected from the database where the ‘jobid’ is found.

<fieldset>
                            <?php do{?>

                                <p><a href="Resume.php?Personid=<?php echo $row['Personid'];?>"><?php echo $row['Personid']?></a></p>
                                <?php echo $row['Title'];?>&nbsp;<?php echo $row['Forename']?>&nbsp;<?php echo $row['Surname']?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $row['ApplicationDate'];?>


                                <?php }while ($row = mysql_fetch_assoc($Personid))?>
                                <br />
                                <?php
                                //Show the pagination links at the bottom of the page
                                if ($pages >= 1 && $page<= $pages)
                                    {
                                        for($i=1;$i<=$pages;$i++)
                                            {   

                                                echo '<a href="?page='.$i.'">'.$i.'</a> ';


                                            }
                                    }

                                ?>        

                        </fieldset>
  • 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-14T13:29:27+00:00Added an answer on June 14, 2026 at 1:29 pm

    You are not passing the Jobid parameter in the subsequent page links.

    echo '<a href="?page='.$i.'">'.$i.'</a> ';
    

    should be

    echo '<a href="?Jobid='.$_GET['Jobid'].'&page='.$i.'">'.$i.'</a> ';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like add error message to page validation in order to display it
I would like to know if it is possible to add pagination with will_paginate
I would like to add the following MIME type to a site run by
I have the following linq-to-entities query with 2 joined tables that I would like
I have own project and i would like add for this class same as
I have a ListView and each item have a TextView. I would like add
I would like to add a GestureDetector to all views (view groups) of an
I would like to add a custom calculation method to a managed object (which
I would like to add roots to a VirtualTreeView http://www.delphi-gems.com/index.php/controls/virtual-treeview with a thread like
I would like to add a hash into an array using Ruby version 1.8.7:

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.