currentRow

Syntax
int currentRow()

Description

The function currentRow() Returns the current row number of the recordset. If past end-of-file, the value is set to 0, the same as row zero. Check the EOF flag instead.


Usage

/*
 * Connection to DB2 sample database
 */
$SQL = "SELECT * FROM act"
$recordset = $db->execute($SQL);
 
/*
 * Go to the End Of File
 */
$recordset->moveLast;
 
Check the current row
$i = $result->currentRow();
print $i;
/*
 * Prints: 17
 */
$i = $result->EOF;
print $i;
/*
 * Prints: 0
 */
 
 
$ok = $recordSet->moveNext()
/*
 * Past EOF
*/
$i = $result->currentRow();
print $i;
/*
 * Prints: 0
 */
$i = $result->EOF;
print $i;
/*
 * Prints: 1
 */