<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
$query = "SELECT Name, CountryCode FROM City ORDER BY Name";
$stmt = mysqli_prepare($link, $query);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $name, $code);
mysqli_stmt_store_result($stmt);
/* zu Zeile Nr. 400 springen */
mysqli_stmt_data_seek($stmt, 399);
mysqli_stmt_fetch($stmt);
printf ("Stadt: %s Ländercode: %s\n", $name, $code);
Die obigen Bespiele erzeugen folgende Ausgabe:
Stadt: Benin City Ländercode: NGA