bool moveLast()
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.
/* * 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 */