I am new to PHP programming i have coded a pagination script in php to show page number when the values exceeds a particular limit. I have tested my script locally (in Wamp) it is working as expected on local server. but when it comes to the live/prod version the same code is not working there.
Adding the details of the code, Please help me with your knowledge
<div class="postarea">
<?php 
include('includes/db.php');
$noresults =8;
$stmt= $connection->prepare( "select j_id, gender, class, subject, location, cname, cno, time, pay, skill, experience, cdate from tutorjob order by 1 desc");
$stmt->execute();
$stmt->bind_result($j_id,$gender, $class, $subject, $location, $cname, $cno, $time, $pay, $skill, $experience, $cdate);
while($stmt->fetch())
{
    //$description=substr($row['content'],0,200);
    //$image=$row['image'];
    ?>
<?php
}
$count = $stmt->num_rows;
?>
<?php 
if (!isset($_GET['page'])) {
    $page = 1;
}else { 
$page= $_GET['page'];
}
$tpr = ($page-1)*$noresults;
 $nopages = ceil($count/$noresults);
 $stmt1= $connection->prepare( "select j_id, gender, class, subject, location, cname, cno, time, pay, skill, experience, cdate from tutorjob order by 1 desc limit ?,?");
 $stmt1->bind_param("ss", $tpr, $noresults);
$stmt1->execute();
$stmt1->bind_result($j_id, $gender, $class, $subject, $location, $cname, $cno, $time, $pay, $skill, $experience, $cdate);
while($stmt1->fetch())
{
    //$description=substr($row['content'],0,200);
    //$image=$row['image'];
    ?>
    <div class="entry">
    <table>
<tr>
   <th colspan="4"><i class="fas fa-paperclip"></i><b> Job Expiry Date</b>   <?php echo $cdate; ?></th>
     </tr>
      <tr><td class="hd">
     Gender </td><td> <?php echo $gender; ?>
     </td><td class="hd">
     Class </td><td><?php echo $class; ?> 
     </td></tr><tr><td class="hd">
     Subject </td><td><?php echo $subject; ?> 
     </td><td class="hd">
     Location </td><td><?php echo $location; ?> 
     </td></tr><tr><td class="hd">
     Contact Name </td><td><?php echo $cname; ?> 
      </td><td class="hd">
     Contact Number </td><td><?php echo $cno; ?> 
     </td></tr><tr><td class="hd">
     Experience </td><td><?php echo $experience; ?> 
     </td><td class="hd">
     Pay </td><td><?php echo $pay; ?> 
      </td></tr>
      <tr>
     <td class="hd">
    <b>Skills Required </b> </td><td  colspan="3"><?php echo $skill; ?>  
      </td>
     </tr>
       <th colspan="4"><div class="link"><i class="fas fa-envelope-open"></i><a href="tutorregister.php">Register/Apply for the job</a></div></th> 
</table>
</div> 
 <?php
}
?>
<div class="pga">
<?php
?>
 <?php
for ($page=1;$page<=$nopages;$page++) {
  echo  '<div class="pg"> <a href="'.$_SERVER['PHP_SELF'].'?page='.$page.'">' . $page. '</a> </div> ' ;
?>
<?php
}
?>
</div>
</div>
