ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:recordset:movenext

moveNext

Syntax
bool moveNext()

Description

The function moveNext() moves the cursor to the next record in a recordset from the current position. If the cursor is successfully moved then the function returns true. If the move is passed EOF the function returns false.


Usage

/*
 * Connection to DB2 sample database
 */
$sql = "SELECT * FROM act";
$recordset = $db->execute($sql);
 
/*
 * Go to the 10th record
 */
$recordset->move(9);
$record = $recordset->fetchObj();
 
print_r($record);
/*
 * Prints
ADOFetchObj Object
(
    [ACTNO] => 100
    [ACTKWD] => TEACH
    [ACTDESC] => TEACH CLASSES
)
*/
 
/*
 * Go to the 11th record
 */
$recordset->moveNext();
$record = $recordset->fetchObj();
 
print_r($record);
/*
 * Prints
ADOFetchObj Object
(
    [ACTNO] => 110
    [ACTKWD] => COURSE
    [ACTDESC] => DEVELOP COURSES
)
*/
v5/reference/recordset/movenext.txt · Last modified: 2020/01/02 16:56 by peterdd