ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:currentrow

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
 */
v5/reference/connection/currentrow.txt · Last modified: 2016/01/17 00:49 by mnewnham