v5:reference:recordset:movefirst
moveFirst
Syntax
bool moveFirst()
Description
The function moveFirst()
moves the cursor to the first 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 ORDER BY ACTNO ASC"; $recordset = $db->execute($sql); /* * Go to the 10th record */ $recordset->move(9); $record = $recordset->fetchObj(); print_r($record); $recordset->moveFirst(); $record = $recordset->fetchObj(); print_r($record);
v5/reference/recordset/movefirst.txt · Last modified: 2020/01/02 16:50 by peterdd