2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 08:13:42 +00:00
|
|
|
<!-- $Revision$ -->
|
2008-01-02 13:58:46 +00:00
|
|
|
<refentry xml:id="mysqli-result.field-seek" xmlns="http://docbook.org/ns/docbook">
|
2007-01-27 17:37:36 +00:00
|
|
|
<refnamediv>
|
2008-01-02 13:58:46 +00:00
|
|
|
<refname>mysqli_result::field_seek</refname>
|
2007-01-27 17:37:36 +00:00
|
|
|
<refname>mysqli_field_seek</refname>
|
|
|
|
<refpurpose>Set result pointer to a specified field offset</refpurpose>
|
|
|
|
</refnamediv>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2010-05-08 21:20:24 +00:00
|
|
|
<para>&style.oop;</para>
|
2012-01-10 08:41:49 +00:00
|
|
|
<methodsynopsis role="oop">
|
2020-06-20 15:02:28 +00:00
|
|
|
<modifier>public</modifier> <type>bool</type><methodname>mysqli_result::field_seek</methodname>
|
2008-01-02 13:58:46 +00:00
|
|
|
<methodparam><type>int</type><parameter>fieldnr</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2010-05-08 21:20:24 +00:00
|
|
|
<para>&style.procedural;</para>
|
2007-01-27 17:37:36 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>mysqli_field_seek</methodname>
|
|
|
|
<methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam>
|
|
|
|
<methodparam><type>int</type><parameter>fieldnr</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2007-01-28 04:25:58 +00:00
|
|
|
Sets the field cursor to the given offset. The next call to
|
|
|
|
<function>mysqli_fetch_field</function> will retrieve the field definition
|
|
|
|
of the column associated with that offset.
|
2007-01-27 17:37:36 +00:00
|
|
|
</para>
|
|
|
|
<note>
|
2007-01-28 04:25:58 +00:00
|
|
|
<para>
|
|
|
|
To seek to the beginning of a row, pass an offset value of zero.
|
|
|
|
</para>
|
2007-01-27 17:37:36 +00:00
|
|
|
</note>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
2007-01-27 17:37:36 +00:00
|
|
|
<para>
|
2007-01-28 04:25:58 +00:00
|
|
|
<variablelist>
|
|
|
|
&mysqli.result.description;
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>fieldnr</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The field number. This value must be in the range from
|
|
|
|
<literal>0</literal> to <literal>number of fields - 1</literal>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2007-01-27 17:37:36 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2007-01-27 17:37:36 +00:00
|
|
|
<para>
|
2008-01-04 21:09:09 +00:00
|
|
|
&return.success;
|
2007-01-27 17:37:36 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="examples">
|
2007-01-27 17:37:36 +00:00
|
|
|
&reftitle.examples;
|
|
|
|
<example>
|
2011-12-29 05:36:04 +00:00
|
|
|
<title>&style.oop;</title>
|
2007-01-27 17:37:36 +00:00
|
|
|
<programlisting role="php">
|
2004-02-22 09:40:50 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-02-25 21:59:16 +00:00
|
|
|
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
/* check connection */
|
|
|
|
if (mysqli_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
$query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5";
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
if ($result = $mysqli->query($query)) {
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
/* Get field information for 2nd column */
|
|
|
|
$result->field_seek(1);
|
|
|
|
$finfo = $result->fetch_field();
|
2007-01-27 17:37:36 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
printf("Name: %s\n", $finfo->name);
|
|
|
|
printf("Table: %s\n", $finfo->table);
|
|
|
|
printf("max. Len: %d\n", $finfo->max_length);
|
|
|
|
printf("Flags: %d\n", $finfo->flags);
|
|
|
|
printf("Type: %d\n\n", $finfo->type);
|
2007-01-27 17:37:36 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
$result->close();
|
|
|
|
}
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
/* close connection */
|
2004-02-22 09:40:50 +00:00
|
|
|
$mysqli->close();
|
|
|
|
?>
|
|
|
|
]]>
|
2010-05-08 23:37:27 +00:00
|
|
|
</programlisting>
|
2011-12-29 05:36:04 +00:00
|
|
|
</example>
|
|
|
|
<example>
|
|
|
|
<title>&style.procedural;</title>
|
2007-01-27 17:37:36 +00:00
|
|
|
<programlisting role="php">
|
2004-02-22 09:40:50 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-02-25 21:59:16 +00:00
|
|
|
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
/* check connection */
|
|
|
|
if (mysqli_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
$query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5";
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
if ($result = mysqli_query($link, $query)) {
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
/* Get field information for 2nd column */
|
|
|
|
mysqli_field_seek($result, 1);
|
|
|
|
$finfo = mysqli_fetch_field($result);
|
2007-01-27 17:37:36 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
printf("Name: %s\n", $finfo->name);
|
|
|
|
printf("Table: %s\n", $finfo->table);
|
|
|
|
printf("max. Len: %d\n", $finfo->max_length);
|
|
|
|
printf("Flags: %d\n", $finfo->flags);
|
|
|
|
printf("Type: %d\n\n", $finfo->type);
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
mysqli_free_result($result);
|
|
|
|
}
|
2004-02-22 09:40:50 +00:00
|
|
|
|
2004-02-25 21:59:16 +00:00
|
|
|
/* close connection */
|
2004-02-22 09:40:50 +00:00
|
|
|
mysqli_close($link);
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-27 17:37:36 +00:00
|
|
|
</programlisting>
|
2010-05-08 23:37:27 +00:00
|
|
|
&examples.outputs;
|
|
|
|
<screen>
|
2004-02-25 21:59:16 +00:00
|
|
|
<![CDATA[
|
|
|
|
Name: SurfaceArea
|
|
|
|
Table: Country
|
|
|
|
max. Len: 10
|
|
|
|
Flags: 32769
|
|
|
|
Type: 4
|
|
|
|
|
|
|
|
]]>
|
2010-05-08 23:37:27 +00:00
|
|
|
</screen>
|
|
|
|
</example>
|
2007-01-27 17:37:36 +00:00
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>mysqli_fetch_field</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-01-27 17:37:36 +00:00
|
|
|
</refentry>
|
2003-03-15 23:01:35 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2003-03-15 23:01:35 +00:00
|
|
|
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
|
|
|
|
-->
|