I have two "buttons" to move the array cursor to the next record or to the prior record. The function using "next" to move to the next (older) record works correctly.
However, the function to move to the prior ("prev") record (which is toward the top of the array) does not work correctly. I suspect that may be related to using "mysqli_data_seek". My belief was that it would set the cursor to the current location and then backtrack to the previous record. Instead the cursor continues to moves forward as if "next" was used instead of "prev". How can I backtrack to the prior record?
function return_next_issue()
{
// Newer Issue - Moves up towards the top of the array.
// mysqli_data_seek($_SESSION['result'], 0);
while($row=mysqli_fetch_array($_SESSION['result'], MYSQL_NUM))
{
if($_SESSION['issuenum'] == $row[0])
{
break;
}
}
prev($_SESSION['result']);
$row=mysqli_fetch_row($_SESSION['result']);
return $row[0];
}