mysqli_data_seek
Adjusts the result pointer to an arbitary row in the result
Description
voidmysqli_data_seek
resourceresult
intoffset
The mysqli_data_seek function seeks to an arbitrary result pointer
specified by the offset in the result set represented by
result. The offset parameter must be between
zero and the total number of rows minus one (0..mysqli_num_rows - 1).
This function can only be used with results attained from the use of the
mysqli_store_result function.
Using the mysqli_data_seek function
0) { // there is at least one row
/* Get the last employee */
mysqli_data_seek($rows, mysqli_num_rows($result) -1);
$employee = mysqli_fetch_row($rows);
printf ("Employee name : %s\n", $employee[0]);
}
mysqli_free_result($rows);
?>
]]>
See also
mysqli_store_result,
mysqli_fetch_row and
mysqli_num_rows.