ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:pageexecute

This is an old revision of the document!


pageExecute

Syntax
obj pageExecute(
   string $sql
      int $rowsPerPage
int $pageNumber
optional mixed $bindVars=false
   )

Description

The method pageExecute() will select the supplied $pageNumber from a recordset, given that it is paginated in pages of $rowsPerPage rows per page. 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->pageExecute($SQL,15,2);
 
print_r($result->getAll());

Author

The original author of this method was Iván Oliva .

v5/reference/connection/pageexecute.1445028452.txt.gz · Last modified: 2017/04/21 11:34 (external edit)