<?
$page=(int)$_GET['page'];
if(empty($page)) $page=1;
$limit=5;
$all=$db->query("select count(*) from `mytable`")->fetchColumn();
$total=ceil($all/$limit);
if($page>$total)$page=1;
$start=$page*$limit-$limit;
if($all==true){
$info=$db->query("select * from `mytable` order by `id` desc limit...