resetPointer
(Since 1.8.3) -- (re)set the internal MySQL pointer
function resetPointer($row_number = 0)
The resetPointer method uses mysql_data_seek to move the internal result pointer. It's useful if you want to move the pointer back (so you can loop through the results again), or if you want to skip through some results (e.g. if you want to start at the 3rd item).
Parameters
| Parameter | Type | Details |
|---|---|---|
| $row_number | INT | move the MySQL pointer to the specified row number |
Returns
True (success), or False (failure)Examples
<?php
$pods = new Pod('event');
$pods->findRecords('id DESC', 25);
$pods->resetPointer(2);
// We set the pointer at 2, so the loop will skip to the 3rd item
while ($pods->fetchRecord()) {
echo $pods->get_field('name');
}
?>
