Okay the idée of this was to make it possible to adjust how many pages should be listed as an URL.
sow it made a simple for loop the i had the idée that i seen lots of people making i look like this in there url 1 2 3 4 5 8 12 and sow on, sow I thought wow way do i not make something like that in my script.
I thought i some minuts and got the idee that must be away to make it possibel to jump in the for loop to page 5 and run loop rom there.
Okay here is my first paging script, the thing is that i trying to learn how..
<?
include ("../../management/connectdb/mysqlcondbrr.php");
$page = isset($_GET['page']) ? intval($_GET['page']) : 0;
$view_pages = 10;
$limit_total_pages =50;
$select_total_pages = " * FROM reg_info ORDER BY regdate DESC LIMIT $limit_total_pages";
$query = mysql_query("SELECT $select_total_pages ");
$pages = mysql_num_rows($query);
$start_page = ($page * $view_pages);
$total_pages = ceil($pages / $view_pages);
if ($total_pages >= 1){
$list_start = $_GET['page'] + 1;
}else{
$list_start = 0;
}
$list_total = $total_pages - 1;
$result = mysql_query("SELECT * FROM reg_info ORDER BY regdate DESC LIMIT $start_page, $view_pages");
echo '<center>' .$list_start. ' of '. $total_pages .' pages</center>';
echo '<center>'. mysql_num_rows($result)." listed users per page. </center>";
while ($row = mysql_fetch_array($result)) {
echo $row['username'];
}
echo '<br><center>';
if ($page > 0) { echo "<a href=\"{$_SERVER['PHP_SELF']}?type=".$_GET['type']."&page=".($page-1)."\">[<<]</a>\n"; }
else{
echo "[<<]\n";
}
echo ' || ';
if ($page < $list_total) { echo "<a href=\"{$_SERVER['PHP_SELF']}?type=".$_GET['type']."&page=".($page+1)."\">[>>]</a>\n"; }
else{
echo "[>>]\n";
}
echo '</center>';
echo "<br>\n";
?>