mysqli_data_seek
result->data_seek
Adjusts the result pointer to an arbitary row in the result
Description
Procedural style:
boolmysqli_data_seek
objectresult
intoffset
Object oriented style (method):
result
bool
data_seek
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 unbuffered results attained from the use of the
mysqli_store_result or mysqli_query functions.
Return values
&return.success;
Example
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);
mysqli_close($link);
?>
]]>
See also
mysqli_store_result,
mysqli_fetch_row,
mysqli_num_rows.