hi all...my id is jihadun_nafs(it is mean strunggle from himself)
i have a code to make "PREV 1 2 3 NEXT" , the problem is if i click the "1 2 3" the data is still same. any one can help me ?
it is the code
PHP Code:<html><head><title>Explore Provisioning limited</title></head><body>
<?
@$urut=1;
@$startdate=$_POST['startdate'];
@$enddate=$_POST['enddate'];
$db=mysql_connect("DbaseSNOC.indosat.com", "root","") or die('Koneksi gagal dibangun:' .mysql_error());
mysql_select_db("wo",$db)or die('Database yang dimaksudkan tidak ada :' .mysql_error());
//$offset=$newoffset;
$limit=20; // rows to return
$numresults=mysql_query("select * from Prov where (status !='Done') order by tgl_wo");
$numrows=mysql_num_rows($numresults);
// next determine if offset has been passed to script, if not use 0
if (empty($offset)) {
$offset=1;
}
// get results
$result=mysql_query("select * ".
"from Prov where (status !='Done')".
"order by tgl_wo limit $offset,$limit");
echo"<table border=1 bordercolor=Azure>";
echo"<tr><td Colspan=17 align=center>WO Received between ";echo $startdate;echo" and "; echo $enddate;
echo"</td></tr>";
echo "<tr> <th>No</th> <th>WO Date</th> <th>WO</th> <th>Segment</th> <th>Customer</th> <th>E1</th><th>DS3</th><th>STM1</th> <th>Rfs date</th> <th>Scope</th> <th>PJ</th> <th>XConn</th> <th>Status</th> <th>Edit</th> <th>Pending</th><th>Lead</th><th>File</th><th> Remark </th>
<th></th></tr>";
// now you can display the results returned
while ($data=mysql_fetch_array($result)) {
// include code to display results as you see fit
// next we need to do the links to other results
if ($offset==1) { // bypass PREV link if offset is 0
$prevoffset=$offset-20;
print "<a href=\"ExploreProvlimit.php?offset=$prevoffset\">PREV</a> \n";
}
// calculate number of pages needing links
$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++;
}
for ($i=1;$i<=$pages;$i++) { // loop thru
$newoffset=$limit*($i-1);
print "<a href=\"ExploreProvlimit.php?offset=$newoffset\">$i</a> \n";
}
// check to see if last page
if (!(($offset/$limit)==$pages) && $pages!=1) {
// not last page so give NEXT link
$newoffset=$offset+$limit;
print "<a href=\"ExploreProvlimit.php?offset=$newoffset\">NEXT</a><p>\n";
}
?>
</body>
</html>







Bookmarks