mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 14:28:56 +00:00

- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
184 lines
4.2 KiB
XML
184 lines
4.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.10 $ -->
|
|
<refentry xml:id="function.mysqli-stmt-data-seek" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>mysqli_stmt_data_seek</refname>
|
|
<refname>stmt->data_seek()</refname>
|
|
<refpurpose>Seeks to an arbitray row in statement result set</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<para>Procedural style:</para>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>mysqli_stmt_data_seek</methodname>
|
|
<methodparam><type>mysqli_stmt</type><parameter>stmt</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>Object oriented style (method):</para>
|
|
<classsynopsis>
|
|
<ooclass><classname>mysqli_stmt</classname></ooclass>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>data_seek</methodname>
|
|
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
</classsynopsis>
|
|
<para>
|
|
Seeks to an arbitrary result pointer in the statement result set.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&mysqli.stmt.description;
|
|
<varlistentry>
|
|
<term><parameter>offset</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Must be between zero and the total number of rows minus one (0..
|
|
<function>mysqli_stmt_num_rows</function> - 1).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.void;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Object oriented style</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* Open a connection */
|
|
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
|
|
|
/* check connection */
|
|
if (mysqli_connect_errno()) {
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
exit();
|
|
}
|
|
|
|
$query = "SELECT Name, CountryCode FROM City ORDER BY Name";
|
|
if ($stmt = $mysqli->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();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<example>
|
|
<title>Procedural style</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* Open a connection */
|
|
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
|
|
|
/* check connection */
|
|
if (mysqli_connect_errno()) {
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
exit();
|
|
}
|
|
|
|
$query = "SELECT Name, CountryCode FROM City ORDER BY Name";
|
|
if ($stmt = mysqli_prepare($link, $query)) {
|
|
|
|
/* execute query */
|
|
mysqli_stmt_execute($stmt);
|
|
|
|
/* bind result variables */
|
|
mysqli_stmt_bind_result($stmt, $name, $code);
|
|
|
|
/* store result */
|
|
mysqli_stmt_store_result($stmt);
|
|
|
|
/* seek to row no. 400 */
|
|
mysqli_stmt_data_seek($stmt, 399);
|
|
|
|
/* fetch values */
|
|
mysqli_stmt_fetch($stmt);
|
|
|
|
printf ("City: %s Countrycode: %s\n", $name, $code);
|
|
|
|
/* close statement */
|
|
mysqli_stmt_close($stmt);
|
|
}
|
|
|
|
/* close connection */
|
|
mysqli_close($link);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
City: Benin City Countrycode: NGA
|
|
]]>
|
|
</screen>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mysqli_prepare</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|