I have my database page look like this:
[1] [2] [3] [4] [5] [6]
the problem is when I have my database growing it will be not nice to look
at because the number will keep growing,
how to make it like this :
<<< 1 2 3 4 >>>
Thanks for the help
require("cobaconfig.php");
$numresult = mysql_query("select * from dataiklanbaris order by id desc");
$total = mysql_num_rows($numresult);
$limit = 20;
if (empty($offset)) {
$offset = 0;
}
$query = "select * from table order by id desc limit $offset, $limit";
$result = mysql_query($query);
$halaman = intval($total/$limit);
if ($jumlah%$limit) {
$page++;
}
for ($i = 1; $i<=$page; $i++) {
$newoffset=$limit*($i-1);
if ($offset != $newoffset) {
echo " [<a href=\"view.php?offset=$newoffset\">$i</a>]";
} else {
echo "[$i]";
}
}
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php