PDF (US Ltr)- 2.4Mb
PDF (A4)- 2.4Mb
Copyright 1997-2021 the PHP Documentation Group.
mysqli_stmt::data_seek
mysqli_stmt_data_seek
Seeks to an arbitrary row in statement result set
Description
Object oriented style
publicvoidmysqli_stmt::data_seek(intoffset);
Procedural style
voidmysqli_stmt_data_seek(mysqli_stmtstatement,
intoffset);
Seeks to an arbitrary result pointer in the statement result set.
mysqli_stmt_store_result
must be called prior tomysqli_stmt_data_seek
.
Parameters
-
stmt
-
Procedural style only: A statement identifier returned by
mysqli_stmt_init
. -
offset
-
Must be between zero and the total number of rows minus one (0..
mysqli_stmt_num_rows
- 1).
Return Values
No value is returned.
Examples
Example 3.75 Object oriented style
prepare($query)) { /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($name, $code); /* store result */ $stmt->store_result(); /* seek to row no. 400 */ $stmt->data_seek(399); /* fetch values */ $stmt->fetch(); printf ("City: %s Countrycode: %s\n", $name, $code); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?>
See Also
mysqli_prepare |