@author Britto Sebastian
Usage of pagination
----------------------
$page = $_REQUEST['page'] ? $_REQUEST['page'] : 1;
$maxRows = MAX_ROWS;
$from = ($page - 1) * $maxRows;
here we want to get the sql results from [$from] to [$maxRows]
ie $sqlQuery .= LIMIT $from,$maxRows
and listing of the results are as usual in php
$totalResult = mysql_num_rows();
$path = "http://localhost/resultPage.php?sortBy={$_REQUEST['sortBy']}&";
$paginate = paginate($page,$totalResult,$_REQUEST['act'],$path);
and the answer is like this
Showing {$paginate['PAGINATE_FROM']} - {$paginate['PAGINATE_TO']} Of {$paginate['PAGINATE_TOTAL']} Results.
also
$paginate['PAGINATE']
|