MySQL::SeekPosition PHP Method

SeekPosition() public method

Returns the current cursor row location
public SeekPosition ( ) : integer
return integer Current row number
    public function SeekPosition()
    {
        return $this->active_row;
    }

Usage Example

Example #1
0
if ($db->Error()) {
    $db->Kill();
}
// Or use: if ($db->Error()) die($db->Error());
// Or: if ($db->Error()) echo $db->Error();
// Execute our query
if (!$db->Query("SELECT * FROM Test")) {
    $db->Kill();
}
// Let's show how many records were returned
echo $db->RowCount() . " records returned.<br />\n<hr />\n";
// Loop through the records using the MySQL object (prefered)
$db->MoveFirst();
while (!$db->EndOfSeek()) {
    $row = $db->Row();
    echo "Row " . $db->SeekPosition() . ": ";
    echo $row->Color . " and " . $row->Age . "<br />\n";
}
// =========================================================================
// The rest of this tutorial covers addition methods of getting to the data
// and is completely optional.
// =========================================================================
echo "<hr />\n";
// ---------------------------------------------------------
// Loop through the records using a counter and display the values
for ($index = 0; $index < $db->RowCount(); $index++) {
    $row = $db->Row($index);
    echo "Index " . $index . ": ";
    echo $row->Color . " and " . $row->Age . "<br />\n";
}
echo "<hr />\n";