ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection: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);
/*
 * Retrieve the record as an object
 */
$record = $recordset->fetchObj;
 
print_r($record);
/*
 * Prints
ADOFetchObj Object
(
    [ACTNO] => 100
    [ACTKWD] => TEACH
    [ACTDESC] => TEACH CLASSES
)
*/
/*
 * Go to the 11th record
 */
$recordSet->moveNext();
/*
 * Retrieve the record as an object
 */
$record = $recordset->fetchObj;
 
print_r($record);
/*
 * Prints
ADOFetchObj Object
(
    [ACTNO] => 110
    [ACTKWD] => COURSE
    [ACTDESC] => DEVELOP COURSES
)
*/
v5/reference/connection/movenext.txt · Last modified: 2016/01/17 01:06 by mnewnham