ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:movelast

moveLast

Syntax
bool moveLast()

Description

The function moveLast() moves the cursor to the last record in a recordset. The only time that the function returns false is if the recordset is empty.


Usage

/*
 * Connection to DB2 sample database
 */
$SQL = "SELECT * FROM act"
$recordset = $db->execute($SQL);
 
/*
 * Go to the 10th record
 */
$recordset->moveLast;
/*
 * Retrieve the record as an object
 */
$record = $recordset->fetchObj;
 
print_r($record);
/*
 * Prints
ADOFetchObj Object
(
    [ACTNO] => 180
    [ACTKWD] => DOC
    [ACTDESC] => DOCUMENT
)
 
$ok = $recordSet->moveNext()
/*
 * Past EOF, $ok returns false
*/
v5/reference/connection/movelast.txt · Last modified: 2016/01/17 01:04 by mnewnham