i'm having problem php pagination.
when click on next page see next results, pagination links , data disappear.
i tried various pagination classes, decided stop on solution.
will extremely grateful if helps find fix.
<html> <head> <title></title> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <?php require "config_pag.php"; $field = $_post['field']; $state = $_post['state']; $page_name="search.php"; $start=$_get['start']; if(strlen($start) > 0 , !is_numeric($start)){ echo "data error"; exit; } $eu = ($start - 0); $limit = 2; $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; $nume = $dbo->query("select count(id) posts state = '$state' , field = '$field'")->fetchcolumn(); echo "<table class='t1'>"; echo "<tr><th>id</th><th>state</th><th>fields</th><th>description</th></tr>"; $query=" select * posts state = '$state' , field = '$field' limit $eu, $limit "; foreach ($dbo->query($query) $row) { $m=$i%2; $i=$i+1; echo "<tr class='r$m'><td>".$row['id']."</td><td>".$row['state']."</td><td>".$row['field']."</td><td>".$row['description']."</td></tr>"; } echo "</table>"; if($nume > $limit ){ echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>"; if($back >=0) { print "<a href='$page_name?start=$back'><font face='verdana' size='2'>prev</font></a>"; } 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?start=$i'><font face='verdana' size='2'>$l</font></a> "; } else { echo "<font face='verdana' size='4' color=red>$l</font>";} $l=$l+1; } echo "</td><td align='right' width='30%'>"; if($this1 < $nume) { print "<a href='$page_name?start=$next'><font face='verdana' size='2'>next</font></a>";} echo "</td></tr></table>"; } ?> </html>
Comments
Post a Comment