10bet网址
MySQL PHP API
Download this Manual
PDF (US Ltr)- 2.4Mb
PDF (A4)- 2.4Mb


MySQL PHP API/.../ mysqli_stmt::data_seek, mysqli_stmt_data_seek

3.9.8mysqli_stmt::data_seek,mysqli_stmt_data_seek

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_resultmust be called prior tomysqli_stmt_data_seek.

Parameters

stmt

Procedural style only: A statement identifier returned bymysqli_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(); ?>

Example 3.76 Procedural style

The above examples will output:

City: Benin City Countrycode: NGA

See Also

mysqli_prepare