WIKINDX METHODS

Method:
limit()

Class:
SQL

Method Call:
include_once("core/sql/SQL.php");
$db = new SQL();
ADODB_RECORDSET $db->limit(STRING: $selectSQL, INT: $limit, INT: $offset);

Description:
Execute a SELECT statement with a LIMIT clause.

The return is an ADODB_RECORDSET suitable for passing to the fetchRow(), loopRecordSet() or fetchOne() methods etc. If it fails to execute the query, the script will exit with an error message.

Usage:
For example (assuming the database object exists within a class as $this->db), the following will return 22 records starting at offset 12 (offsets are numbered from 0):

	$selectSql = $this->db->selectNoExecute(array("WKX_resource"), array("title"));
	$recordset = $this->db->limit($selectSql, 22, 12);

WIKINDX home      WIKINDX usage      WIKINDX classes