Following php paging code is working perfectly on local machine but when i run it on the hosting server it only displays the first 5 records and even when i click next or number of record pages it still display the first five
<?
include("../_includes/mailto.php");
require "config.php"; // All database details will be included here
$page_name="visitor_list.php"; // If you use this code with a different page ( or file ) name then change this
if(!isset($start)) { // This variable is set to zero for the first page
$start = 0;
}
$eu = ($start - 0);
$limit = 5; // No of records to be shown per page.
$this = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
/////////////// WE have to find out the number of records in our table. We will use this to break the pages///////
$order = $_GET['orderby'];
$query2=" SELECT * FROM Visitors order by '$order' ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
$bgcolor="#f1f1f1";
$query=" SELECT * FROM Visitors order by '$order' limit $eu, $limit ";
$result=mysql_query($query);
echo mysql_error();
?>
<html><!-- InstanceBegin template="/Templates/admin.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<link type="text/css" rel="stylesheet" href="../styles/admin.css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="db_images/logo.gif" width="255" height="72" border="0" usemap="#Map"></td>
</tr>
<tr>
<td bgcolor="black">
<div align="center" id="navcontainer">
<ul id="navlist">
<li><a href="StanHomeList.php" title="">Cities</a></li>
<li><a href="SubdivisionList.php" title="">Subdivisions</a></li>
<li><a href="LotList.php" title="">Lots</a></li>
<li><a href="StanHomeList.php" title="">Semi-Custom Homes</a></li>
<li><a href="FloorplanList.php" title="">Floorplans & Elevations</a></li>
<li><a href="VisitorList.php" title="">Visitors</a></li>
<li><a href="#" title="">Web Statistics</a></li>
</ul>
</div>
</td>
</tr>
</table>
<div align="center" style="margin-top:20px; max-width: 750px">
<!-- InstanceBeginEditable name="AdminContent" -->
<p> </p>
<table width="708" border="0" cellpadding="3">
<tr bgcolor="#CCCCCC">
<td colspan="5" class="dataHdr2">Visitors List </td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="175"><p><strong><a href="visitor_list.php?orderby=VisitorFirstName">First</a> / <a href="visitor_list.php?orderby=VisitorLastName">Last Name</a><br>
<a href="visitor_list.php?orderby=VisitorMailing1">Mailing Address</a><br>
<a href="visitor_list.php?orderby=VisitorCity">City</a> / <a href="visitor_list.php?orderby=VisitorState">State</a> / <a href="visitor_list.php?orderby=VisitorZip">Zip</a> </strong></p> </td>
<td width="81"><strong><a href="visitor_list.php?orderby=VisitorEmail">Email</a><br>
<a href="visitor_list.php?orderby=VisitorPhone">Phone</a></strong></td>
<td width="91"><strong><a href="visitor_list.php?orderby=NKHContactPerson">NKH Contact</a><br>
<a href="visitor_list.php?orderby=NKHLastContactDate">Last Contact</a> </strong></td>
<td width="70"><strong><a href="visitor_list.php?orderby=NKHContact">Contacted</a></strong></td>
<td width="249"><strong>Internal Notes/Visitors Notes </strong></td>
</tr>
<?php
while($noticia = mysql_fetch_array($result))
{
if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';}
else{$bgcolor='#f1f1f1';}
?>
<tr>
<td bgcolor='<?php echo $bgcolor;?>'><?php echo $noticia[1];?> <?php echo $noticia[2];?><br><?php echo $noticia[3];?><br><?php echo $noticia[4];?><br><?php echo $noticia[5];?>/ <?php echo $noticia[6];?>/ <?php echo $noticia[7];?></td>
<td bgcolor='<?php echo $bgcolor;?>'><?php echo $noticia[8];?><br><?php echo $noticia[9];?></td>
<td bgcolor='<?php echo $bgcolor;?>'><?php echo $noticia['NKHContactPerson'];?><br><?php echo $noticia['NKHLastContactDate'];?></td>
<td bgcolor='<?php echo $bgcolor;?>'><?php echo $noticia['NKHContact'];?></td>
<td bgcolor='<?php echo $bgcolor;?>'><?php echo $noticia['NKHNotes'];?><br><?php echo $noticia['VisitorComments'];?></td>
</tr>
<?php }?>
</table>
<p>
<?php
echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>";
//// if our variable $back is equal to 0 or more then only we will display the link to move back ////////
if($back >=0) {
print "<a href='$page_name?orderby=$order&start=$back'><font face='Verdana' size='2'>PREV</font></a>";
}
//////////////// Let us display the page links at center. We will not display the current page as a link ///////////
echo "</td><td align=center width='30%'>";
$i=0;
$l=1;
for($i=0;$i < $nume;$i=$i+$limit){
if($i <> $eu){
echo " <a href='$page_name?orderby=$order&start=$i'><font face='Verdana' size='2'>$l</font></a> ";
}
else { echo "<font face='Verdana' size='4' color=red>$l</font>";} /// Current page is not displayed as link and given font color red
$l=$l+1;
}
echo "</td><td align='right' width='30%'>";
///////////// If we are not in the last page then Next link will be displayed. Here we check that /////
if($this < $nume) {
print "<a href='$page_name?orderby=$order&start=$next'><font face='Verdana' size='2'>NEXT</font></a>";}
echo "</td></tr></table>";
?>
</p>
<!-- InstanceEndEditable --></div>
<div align="center" class="footer"><? mailto('larry@sigmawebstudios.com','email the webmaster');?></div>
<map name="Map">
<area shape="rect" coords="3,3,251,69" href="admin.php" alt="NKH Admin Home">
</map>
</body>
<!-- InstanceEnd --></html>