====== cachePageExecute ======
~~NOTOC~~
== Syntax ==
obj cachePageExecute(
int $secs2cache,
string $sql
int $rowsPerPage
int $pageNumber
optional mixed $bindVars=false
)
== See Also ==
* [[v5:reference:connection:pageexecute|pageExecute()]]
* [[v5:reference:recordset:atfirstpage|atFirstPage()]]
* [[v5:reference:recordset:atlastpage|atLastPage()]]
===== Description =====
The method ''cachePageExecute()'' will select the supplied //$pageNumber// from a a possibly cached recordset, given that it is paginated in pages of //$rowsPerPage// rows. It also saves two boolean values saying if the given page is the first and/or last one of the recordset.
-----------------------
===== Usage =====
$SQL = "SELECT * FROM Orders";
/*
* Gets the second page of records, based on 15 records per page
*/
$result = $db->cachePageExecute(3600,$SQL,15,2);
print_r($result->getAll());