Hi All,
I tried this coding as given below,
[code=php]
<?php
require_once “include/connect.php”;
$limit = 10;
$query_count = “SELECT count(*) FROM dt_defect”;
$result_count = mysql_query($query_count);
$totalrows = mysql_num_rows($result_count);
$page = (!empty($_REQUEST[‘page’])) ? $_REQUEST[‘page’] : 1;
$limitvalue = $page * $limit – ($limit);
$query = “SELECT * FROM dt_defect LIMIT $limitvalue, $limit”;
$result = mysql_query($query) or die(“Error: ” . mysql_error());
if(mysql_num_rows($result) == 0){
echo(“Nothing to Display!”);
}
echo “<table width=”50%” border=”0″ cellpadding=”2″ cellspacing=”2″>
<tr>
<td width=”110″><b><small>Defect Id</small></b></td>
<td><b></b></td>
<td><b><small>Tester Name</small></b></td>
</tr>”;
// Define your colors for the alternating rows
$color1 = “#ADD8E6”;
$color2 = “#E0FFFF”;
$row_count = 0;
echo(“<table>”);
while($row = mysql_fetch_array($result)){
$did=$row[“defect_id”];
$mid=$row[“mail_id”];
echo “<tr>
<td width=”110″ bgcolor=”$row_color” nowrap>$did
</td>
<td width=”120″ bgcolor=”$row_color” nowrap>$mid
</td>
</tr>”;
}
echo(“</table>”);
if ($s>=1) { // bypass PREV link if s is 0
$prevs=($s-$limit);
print “ <a href=”$PHP_SELF?s=$prevs&q=$var”><<
Prev 10</a>  ”;
}
$pages=intval($numrows/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
if ($numrows%$limit) {
// has remainder so add one page
$pages++;
}
// check to see if last page
if (!((($s+$limit)/$limit)==$pages) && $pages!=1) {
// not last page so give NEXT link
$news=$s+$limit;
echo “ <a href=”$PHP_SELF?s=$news&q=$var”>Next 10 >></a>”;
}
$a = $s + ($limit);
if ($a > $numrows) { $a = $numrows; }
$b = $s + 1;
echo “<p>Showing results $b to $a of $numrows</p>”;
mysql_free_result($result);
?>
</table>
The first 10 records r correctly displayed by when i click on Next >> the same page is displayed,the next set od records are not displayed.
Can anybody help me,
Thanks,
erp_cool