cvs: phpdoc /en/reference/mysqli mysqli_result.xml /en/reference/mysqli/functions mysqli-data-seek.xml mysqli-fetch-array.xml
mysqli-fetch-field-direct.xml mysqli-fetch-field.xml mysqli-fetch-fields.xml mysqli-fetch-lengths.xml mysqli-fetch-object.xml mysqli-fetch-row.xml
mysqli-field-seek.xml mysqli-field-tell.xml mysqli-free-result.xml mysqli-num-fields.xml mysqli-num-rows.xml /en/reference/mysqli/mysqli_result
current-field.xml data-seek.xml fetch-array.xml fetch-assoc.xml fetch-field-direct.xml fetch-field.xml fetch-fields.xml fetch-object.xml fetch-row.xml
field-count.xml field-seek.xml free.xml lengths.xml num-rows.xml
| From: | Hannes Magnusson | Date: | Wed, 02 Jan 2008 13:32:54 +0000 |
| Subject: | cvs: phpdoc /en/reference/mysqli mysqli_result.xml /en/reference/mysqli/functions mysqli-data-seek.xml mysqli-fetch-array.xml mysqli-fetch-field-direct.xml mysqli-fetch-field.xml mysqli-fetch-fields.xml mysqli-fetch-lengths.xml mysqli-fetch-object.xml mysqli-fetch-row.xml mysqli-field-seek.xml mysqli-field-tell.xml mysqli-free-result.xml mysqli-num-fields.xml mysqli-num-rows.xml /en/reference/mysqli/mysqli_result current-field.xml data-seek.xml fetch-array.xml fetch-assoc.xml fetch-field-direct.xml fetch-field.xml fetch-fields.xml fetch-object.xml fetch-row.xml field-count.xml field-seek.xml free.xml lengths.xml num-rows.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-979@lists.php.net to get a copy of this message | ||
bjori Wed Jan 2 13:32:54 2008 UTC
Added files:
/phpdoc/en/reference/mysqli/mysqli_result current-field.xml
data-seek.xml
fetch-array.xml
fetch-assoc.xml
fetch-field-direct.xml
fetch-field.xml
fetch-fields.xml
fetch-object.xml
fetch-row.xml
field-count.xml
field-seek.xml free.xml
lengths.xml num-rows.xml
Removed files:
/phpdoc/en/reference/mysqli/functions mysqli-data-seek.xml
mysqli-fetch-array.xml
mysqli-fetch-field-direct.xml
mysqli-fetch-field.xml
mysqli-fetch-fields.xml
mysqli-fetch-lengths.xml
mysqli-fetch-object.xml
mysqli-fetch-row.xml
mysqli-field-seek.xml
mysqli-field-tell.xml
mysqli-free-result.xml
mysqli-num-fields.xml
mysqli-num-rows.xml
Modified files:
/phpdoc/en/reference/mysqli mysqli_result.xml
Log:
- Rename mysqli_result methods from functions/ to mysqli_result/
- Update the file entities in mysqli_result.xml
NOTE:
mysqli-field-tell.xml => current-field.xml
mysqli-free-result.xml => free.xml
mysqli-fetch-lengths.xml => lengths.xml
mysqli-num-rows.xml => num-rows.xml
mysqli-fetch-row.xml => fetch-row.xml
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mysqli/mysqli_result.xml diff -u phpdoc/en/reference/mysqli/mysqli_result.xml:1.3 phpdoc/en/reference/mysqli/mysqli_result.xml:1.4 --- phpdoc/en/reference/mysqli/mysqli_result.xml:1.3 Wed Dec 26 18:56:29 2007 +++ phpdoc/en/reference/mysqli/mysqli_result.xml Wed Jan 2 13:32:53 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <reference xml:id="class.mysqli-result" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The MySQLi_Result class</title> <titleabbrev>MySQLi_Result</titleabbrev> @@ -42,23 +42,9 @@ </partintro> -<!-- &reference.mysqli.entities.mysqli-result; --> -<!-- {{{ FIXME: Remove me --> -&reference.mysqli.functions.mysqli-free-result; -&reference.mysqli.functions.mysqli-data-seek; -&reference.mysqli.functions.mysqli-fetch-array; -&reference.mysqli.functions.mysqli-fetch-assoc; -&reference.mysqli.functions.mysqli-fetch-field-direct; -&reference.mysqli.functions.mysqli-fetch-field; -&reference.mysqli.functions.mysqli-fetch-fields; -&reference.mysqli.functions.mysqli-fetch-object; -&reference.mysqli.functions.mysqli-fetch-row; -&reference.mysqli.functions.mysqli-field-seek; -&reference.mysqli.functions.mysqli-field-tell; -&reference.mysqli.functions.mysqli-fetch-lengths; -<!-- }}} --> + &reference.mysqli.entities.mysqli-result; - </reference> +</reference> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/current-field.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/current-field.xml +++ phpdoc/en/reference/mysqli/mysqli_result/current-field.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-field-tell" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_field_tell</refname> <refname>result->current_field</refname> <refpurpose>Get current field offset of a result pointer</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_tell</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis> <type>int</type><varname>current_field</varname> </fieldsynopsis> </classsynopsis> <para> Returns the position of the field cursor used for the last <function>mysqli_fetch_field</function> call. This value can be used as an argument to <function>mysqli_field_seek</function>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns current offset of field cursor. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ while ($finfo = $result->fetch_field()) { /* get fieldpointer offset */ $currentfield = $result->current_field; printf("Column %d:\n", $currentfield); 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); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all fields */ while ($finfo = mysqli_fetch_field($result)) { /* get fieldpointer offset */ $currentfield = mysqli_field_tell($result); printf("Column %d:\n", $currentfield); 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); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Column 1: Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Column 2: Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_field</function></member> <member><function>mysqli_field_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/data-seek.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/data-seek.xml +++ phpdoc/en/reference/mysqli/mysqli_result/data-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-data-seek" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_data_seek</refname> <refname>result->data_seek()</refname> <refpurpose>Adjusts the result pointer to an arbitary row in the result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_data_seek</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>data_seek</methodname> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> The <function>mysqli_data_seek</function> function seeks to an arbitrary result pointer specified by the <parameter>offset</parameter> in the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; <varlistentry> <term><parameter>offset</parameter></term> <listitem> <para> The field offset. Must be between zero and the total number of rows minus one (0..<function>mysqli_num_rows</function> - 1). </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function can only be used with buffered results attained from the use of the <function>mysqli_store_result</function> or <function>mysqli_query</function> functions. </para> </note> </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 ($result = $mysqli->query( $query)) { /* seek to row no. 400 */ $result->data_seek(399); /* fetch row */ $row = $result->fetch_row(); printf ("City: %s Countrycode: %s\n", $row[0], $row[1]); /* free result set*/ $result->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 (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER BY Name"; if ($result = mysqli_query($link, $query)) { /* seek to row no. 400 */ mysqli_data_seek($result, 399); /* fetch row */ $row = mysqli_fetch_row($result); printf ("City: %s Countrycode: %s\n", $row[0], $row[1]); /* free result set*/ mysqli_free_result($result); } /* 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_store_result</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_num_rows</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-array.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-array.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-array.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-array" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_array</refname> <refname>result->fetch_array()</refname> <refpurpose>Fetch a result row as an associative, a numeric array, or both</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_fetch_array</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>mixed</type><methodname>fetch_array</methodname> <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Returns an array that corresponds to the fetched row or &null; if there are no more rows for the resultset represented by the <parameter>result</parameter> parameter. </para> <para> <function>mysqli_fetch_array</function> is an extended version of the <function>mysqli_fetch_row</function> function. In addition to storing the data in the numeric indices of the result array, the <function>mysqli_fetch_array</function> function can also store the data in associative indices, using the field names of the result set as keys. </para> &database.field-case; &database.fetch-null; <para> If two or more columns of the result have the same field names, the last column will take precedence and overwrite the earlier data. In order to access multiple columns with the same name, the numerically indexed version of the row must be used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; <varlistentry> <term><parameter>resulttype</parameter></term> <listitem> <para> This optional parameter is a constant indicating what type of array should be produced from the current row data. The possible values for this parameter are the constants <constant>MYSQLI_ASSOC</constant>, <constant>MYSQLI_NUM</constant>, or <constant>MYSQLI_BOTH</constant>. Defaults to <constant>MYSQLI_BOTH</constant>. </para> <para> By using the <constant>MYSQLI_ASSOC</constant> constant this function will behave identically to the <function>mysqli_fetch_assoc</function>, while <constant>MYSQLI_NUM</constant> will behave identically to the <function>mysqli_fetch_row</function> function. The final option <constant>MYSQLI_BOTH</constant> will create a single array with the attributes of both. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of strings that corresponds to the fetched row or &null; if there are no more rows in resultset. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID LIMIT 3"; $result = $mysqli->query($query); /* numeric array */ $row = $result->fetch_array(MYSQLI_NUM); printf ("%s (%s)\n", $row[0], $row[1]); /* associative array */ $row = $result->fetch_array(MYSQLI_ASSOC); printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); /* associative and numeric array */ $row = $result->fetch_array(MYSQLI_BOTH); printf ("%s (%s)\n", $row[0], $row["CountryCode"]); /* free result set */ $result->close(); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID LIMIT 3"; $result = mysqli_query($link, $query); /* numeric array */ $row = mysqli_fetch_array($result, MYSQLI_NUM); printf ("%s (%s)\n", $row[0], $row[1]); /* associative array */ $row = mysqli_fetch_array($result, MYSQLI_ASSOC); printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); /* associative and numeric array */ $row = mysqli_fetch_array($result, MYSQLI_BOTH); printf ("%s (%s)\n", $row[0], $row["CountryCode"]); /* free result set */ mysqli_free_result($result); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Kabul (AFG) Qandahar (AFG) Herat (AFG) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-assoc.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-assoc.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-assoc.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-assoc" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_assoc</refname> <refname>mysqli->fetch_assoc()</refname> <refpurpose>Fetch a result row as an associative array</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>array</type><methodname>mysqli_fetch_assoc</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>array</type><methodname>fetch_assoc</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Returns an associative array that corresponds to the fetched row or &null; if there are no more rows. </para> &database.field-case; &database.fetch-null; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an associative array of strings representing the fetched row in the result set, where each key in the array represents the name of one of the result set's columns or &null; if there are no more rows in resultset. </para> <para> If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by using <function>mysqli_fetch_row</function> or add alias names. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = $mysqli->query($query)) { /* fetch associative array */ while ($row = $result->fetch_assoc()) { printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); } /* free result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($row = mysqli_fetch_assoc($result)) { printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-field-direct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-field-direct.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-field-direct.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-field-direct" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_field_direct</refname> <refname>result->fetch_field_direct()</refname> <refpurpose>Fetch meta-data for a single field</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_fetch_field_direct</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>object</type><methodname>fetch_field_direct</methodname> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Returns an object which contains field definition informations from specified resultset. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <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> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object which contains field definition information or &false; if no field information for specified <literal>fieldnr</literal> is available. </para> <para> <table> <title>Object attributes</title> <tgroup cols='2'> <thead> <row> <entry>Attribute</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>name</entry> <entry>The name of the column</entry> </row> <row> <entry>orgname</entry> <entry>Original column name if an alias was specified</entry> </row> <row> <entry>table</entry> <entry>The name of the table this field belongs to (if not calculated)</entry> </row> <row> <entry>orgtable</entry> <entry>Original table name if an alias was specified</entry> </row> <row> <entry>def</entry> <entry>The default value for this field, represented as a string</entry> </row> <row> <entry>max_length</entry> <entry>The maximum width of the field for the result set.</entry> </row> <row> <entry>length</entry> <entry>The width of the field, as specified in the tabl definition.</entry> </row> <row> <entry>charsetnr</entry> <entry>The character set number for the field.</entry> </row> <row> <entry>flags</entry> <entry>An integer representing the bit-flags for the field.</entry> </row> <row> <entry>type</entry> <entry>The data type used for this field</entry> </row> <row> <entry>decimals</entry> <entry>The number of decimals used (for integer fields)</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Name LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for column 'SurfaceArea' */ $finfo = $result->fetch_field_direct(1); 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", $finfo->type); $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Name LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for column 'SurfaceArea' */ $finfo = mysqli_fetch_field_direct($result, 1); 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", $finfo->type); mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_num_fields</function></member> <member><function>mysqli_fetch_field</function></member> <member><function>mysqli_fetch_fields</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-field.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-field.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-field.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-field" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_field</refname> <refname>result->fetch_field()</refname> <refpurpose>Returns the next field in the result set</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_fetch_field</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>object</type><methodname>fetch_field</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Returns the definition of one column of a result set as an object. Call this function repeatedly to retrieve information about all columns in the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object which contains field definition information or &false; if no field information is available. </para> <para> <table> <title>Object properties</title> <tgroup cols='2'> <thead> <row> <entry>Property</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>name</entry> <entry>The name of the column</entry> </row> <row> <entry>orgname</entry> <entry>Original column name if an alias was specified</entry> </row> <row> <entry>table</entry> <entry>The name of the table this field belongs to (if not calculated)</entry> </row> <row> <entry>orgtable</entry> <entry>Original table name if an alias was specified</entry> </row> <row> <entry>def</entry> <entry>The default value for this field, represented as a string</entry> </row> <row> <entry>max_length</entry> <entry>The maximum width of the field for the result set.</entry> </row> <row> <entry>length</entry> <entry>The width of the field, as specified in the table definition.</entry> </row> <row> <entry>charsetnr</entry> <entry>The character set number for the field.</entry> </row> <row> <entry>flags</entry> <entry>An integer representing the bit-flags for the field.</entry> </row> <row> <entry>type</entry> <entry>The data type used for this field</entry> </row> <row> <entry>decimals</entry> <entry>The number of decimals used (for integer fields)</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ while ($finfo = $result->fetch_field()) { 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); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all fields */ while ($finfo = mysqli_fetch_field($result)) { 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); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_num_fields</function></member> <member><function>mysqli_fetch_field_direct</function></member> <member><function>mysqli_fetch_fields</function></member> <member><function>mysqli_field_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-fields.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-fields.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-fields.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-fields" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_fields</refname> <refname>result->fetch_fields()</refname> <refpurpose>Returns an array of objects representing the fields in a result set</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural Style:</para> <methodsynopsis> <type>array</type><methodname>mysqli_fetch_fields</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>array</type><methodname>fetch_fields</methodname> <void/> </methodsynopsis> </classsynopsis> <para> This function serves an identical purpose to the <function>mysqli_fetch_field</function> function with the single difference that, instead of returning one object at a time for each field, the columns are returned as an array of objects. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of objects which contains field definition information or &false; if no field information is available. </para> <para> <table> <title>Object properties</title> <tgroup cols='2'> <thead> <row> <entry>Property</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>name</entry> <entry>The name of the column</entry> </row> <row> <entry>orgname</entry> <entry>Original column name if an alias was specified</entry> </row> <row> <entry>table</entry> <entry>The name of the table this field belongs to (if not calculated)</entry> </row> <row> <entry>orgtable</entry> <entry>Original table name if an alias was specified</entry> </row> <row> <entry>def</entry> <entry>The default value for this field, represented as a string</entry> </row> <row> <entry>max_length</entry> <entry>The maximum width of the field for the result set.</entry> </row> <row> <entry>length</entry> <entry>The width of the field, as specified in the table definition.</entry> </row> <row> <entry>charsetnr</entry> <entry>The character set number for the field.</entry> </row> <row> <entry>flags</entry> <entry>An integer representing the bit-flags for the field.</entry> </row> <row> <entry>type</entry> <entry>The data type used for this field</entry> </row> <row> <entry>decimals</entry> <entry>The number of decimals used (for integer fields)</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ $finfo = $result->fetch_fields(); foreach ($finfo as $val) { printf("Name: %s\n", $val->name); printf("Table: %s\n", $val->table); printf("max. Len: %d\n", $val->max_length); printf("Flags: %d\n", $val->flags); printf("Type: %d\n\n", $val->type); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all columns */ $finfo = mysqli_fetch_fields($result); foreach ($finfo as $val) { printf("Name: %s\n", $val->name); printf("Table: %s\n", $val->table); printf("max. Len: %d\n", $val->max_length); printf("Flags: %d\n", $val->flags); printf("Type: %d\n\n", $val->type); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_num_fields</function></member> <member><function>mysqli_fetch_field_direct</function></member> <member><function>mysqli_fetch_field</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-object.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-object.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-object.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-object" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_object</refname> <refname>result->fetch_object()</refname> <refpurpose>Returns the current row of a result set as an object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_fetch_object</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>object</type><methodname>fetch_object</methodname> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> The <function>mysqli_fetch_object</function> will return the current row result set as an object where the attributes of the object represent the names of the fields found within the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; <varlistentry> <term><parameter>class_name</parameter></term> <listitem> <para> </para> </listitem> </varlistentry> <varlistentry> <term><parameter>params</parameter></term> <listitem> <para> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object with string properties that corresponds to the fetched row or &null; if there are no more rows in resultset. </para> &database.field-case; &database.fetch-null; </refsect1> <refsect1 role="changelog"> &reftitle.changelog; <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>5.0.0</entry> <entry> Added the ability to return as a different object. </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = $mysqli->query($query)) { /* fetch object array */ while ($obj = $result->fetch_object()) { printf ("%s (%s)\n", $obj->Name, $obj->CountryCode); } /* free result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($obj = mysqli_fetch_object($result)) { printf ("%s (%s)\n", $obj->Name, $obj->CountryCode); } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-row.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-row.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-row.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-row" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_row</refname> <refname>result->fetch_row()</refname> <refpurpose>Get a result row as an enumerated array</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_fetch_row</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>mixed</type><methodname>fetch_row</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Fetches one row of data from the result set and returns it as an enumerated array, where each column is stored in an array offset starting from 0 (zero). Each subsequent call to this function will return the next row within the result set, or &null; if there are no more rows. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> <function>mysqli_fetch_row</function> returns an array of strings that corresponds to the fetched row or &null; if there are no more rows in result set. </para> &database.fetch-null; </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = $mysqli->query($query)) { /* fetch object array */ while ($row = $result->fetch_row()) { printf ("%s (%s)\n", $row[0], $row[1]); } /* free result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($row = mysqli_fetch_row($result)) { printf ("%s (%s)\n", $row[0], $row[1]); } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/field-count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/field-count.xml +++ phpdoc/en/reference/mysqli/mysqli_result/field-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-num-fields" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_num_fields</refname> <refname>result->field_count</refname> <refpurpose>Get the number of fields in a result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_num_fields</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>int</type><varname>field_count</varname></fieldsynopsis> </classsynopsis> <para> Returns the number of fields from specified result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The number of fields from a result set. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = $mysqli->query("SELECT * FROM City ORDER BY ID LIMIT 1")) { /* determine number of fields in result set */ $field_cnt = $result->field_count; printf("Result set has %d fields.\n", $field_cnt); /* close result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = mysqli_query($link, "SELECT * FROM City ORDER BY ID LIMIT 1")) { /* determine number of fields in result set */ $field_cnt = mysqli_num_fields($result); printf("Result set has %d fields.\n", $field_cnt); /* close result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Result set has 5 fields. ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_field</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/field-seek.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/field-seek.xml +++ phpdoc/en/reference/mysqli/mysqli_result/field-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-field-seek" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_field_seek</refname> <refname>result->field_seek()</refname> <refpurpose>Set result pointer to a specified field offset</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>field_seek</methodname> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> 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. </para> <note> <para> To seek to the beginning of a row, pass an offset value of zero. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <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> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the previous value of field cursor. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for 2nd column */ $result->field_seek(1); $finfo = $result->fetch_field(); 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); $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for 2nd column */ mysqli_field_seek($result, 1); $finfo = mysqli_fetch_field($result); 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); mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_field</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/free.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/free.xml +++ phpdoc/en/reference/mysqli/mysqli_result/free.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-free-result" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_free_result</refname> <refname>result->free()</refname> <refpurpose>Frees the memory associated with a result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>void</type><methodname>mysqli_free_result</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (all methods are equivalent):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>void</type><methodname>free</methodname> <void /> </methodsynopsis> <methodsynopsis> <type>void</type><methodname>close</methodname> <void /> </methodsynopsis> <methodsynopsis> <type>void</type><methodname>free_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Frees the memory associated with the result. </para> <note> <para> You should always free your result with <function>mysqli_free_result</function>, when your result object is not needed anymore. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.void; </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_query</function></member> <member><function>mysqli_stmt_store_result</function></member> <member><function>mysqli_store_result</function></member> <member><function>mysqli_use_result</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/lengths.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/lengths.xml +++ phpdoc/en/reference/mysqli/mysqli_result/lengths.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-lengths" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_lengths</refname> <refname>result->lengths()</refname> <refpurpose>Returns the lengths of the columns of the current row in the result set</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>array</type><methodname>mysqli_fetch_lengths</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>array</type><varname>lengths</varname></fieldsynopsis> </classsynopsis> <para> The <function>mysqli_fetch_lengths</function> function returns an array containing the lengths of every column of the current row within the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An array of integers representing the size of each column (not including any terminating null characters). &false; if an error occurred. </para> <para> <function>mysqli_fetch_lengths</function> is valid only for the current row of the result set. It returns &false; if you call it before calling mysqli_fetch_row/array/object or after retrieving all rows in the result. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 * from Country ORDER BY Code LIMIT 1"; if ($result = $mysqli->query($query)) { $row = $result->fetch_row(); /* display column lengths */ foreach ($result->lengths as $i => $val) { printf("Field %2d has Length %2d\n", $i+1, $val); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 * from Country ORDER BY Code LIMIT 1"; if ($result = mysqli_query($link, $query)) { $row = mysqli_fetch_row($result); /* display column lengths */ foreach (mysqli_fetch_lengths($result) as $i => $val) { printf("Field %2d has Length %2d\n", $i+1, $val); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Field 1 has Length 3 Field 2 has Length 5 Field 3 has Length 13 Field 4 has Length 9 Field 5 has Length 6 Field 6 has Length 1 Field 7 has Length 6 Field 8 has Length 4 Field 9 has Length 6 Field 10 has Length 6 Field 11 has Length 5 Field 12 has Length 44 Field 13 has Length 7 Field 14 has Length 3 Field 15 has Length 2 ]]> </screen> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/num-rows.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/num-rows.xml +++ phpdoc/en/reference/mysqli/mysqli_result/num-rows.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-num-rows" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_num_rows</refname> <refname>result->num_rows</refname> <refpurpose>Gets the number of rows in a result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_num_rows</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>int</type><varname>num_rows</varname></fieldsynopsis> </classsynopsis> <para> Returns the number of rows in the result set. </para> <para> The use of <function>mysqli_num_rows</function> depends on whether you use buffered or unbuffered result sets. In case you use unbuffered resultsets <function>mysqli_num_rows</function> will not correct the correct number of rows until all the rows in the result have been retrieved. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns number of rows in the result set. </para> <note> <para> If the number of rows is greater than maximal int value, the number will be returned as a string. </para> </note> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = $mysqli->query("SELECT Code, Name FROM Country ORDER BY Name")) { /* determine number of rows result set */ $row_cnt = $result->num_rows; printf("Result set has %d rows.\n", $row_cnt); /* close result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = mysqli_query($link, "SELECT Code, Name FROM Country ORDER BY Name")) { /* determine number of rows result set */ $row_cnt = mysqli_num_rows($result); printf("Result set has %d rows.\n", $row_cnt); /* close result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Result set has 239 rows. ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_affected_rows</function></member> <member><function>mysqli_store_result</function></member> <member><function>mysqli_use_result</function></member> <member><function>mysqli_query</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 -->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mysqli/mysqli_result.xml diff -u phpdoc/en/reference/mysqli/mysqli_result.xml:1.3 phpdoc/en/reference/mysqli/mysqli_result.xml:1.4 --- phpdoc/en/reference/mysqli/mysqli_result.xml:1.3 Wed Dec 26 18:56:29 2007 +++ phpdoc/en/reference/mysqli/mysqli_result.xml Wed Jan 2 13:32:53 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <reference xml:id="class.mysqli-result" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The MySQLi_Result class</title> <titleabbrev>MySQLi_Result</titleabbrev> @@ -42,23 +42,9 @@ </partintro> -<!-- &reference.mysqli.entities.mysqli-result; --> -<!-- {{{ FIXME: Remove me --> -&reference.mysqli.functions.mysqli-free-result; -&reference.mysqli.functions.mysqli-data-seek; -&reference.mysqli.functions.mysqli-fetch-array; -&reference.mysqli.functions.mysqli-fetch-assoc; -&reference.mysqli.functions.mysqli-fetch-field-direct; -&reference.mysqli.functions.mysqli-fetch-field; -&reference.mysqli.functions.mysqli-fetch-fields; -&reference.mysqli.functions.mysqli-fetch-object; -&reference.mysqli.functions.mysqli-fetch-row; -&reference.mysqli.functions.mysqli-field-seek; -&reference.mysqli.functions.mysqli-field-tell; -&reference.mysqli.functions.mysqli-fetch-lengths; -<!-- }}} --> + &reference.mysqli.entities.mysqli-result; - </reference> +</reference> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/current-field.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/current-field.xml +++ phpdoc/en/reference/mysqli/mysqli_result/current-field.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-field-tell" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_field_tell</refname> <refname>result->current_field</refname> <refpurpose>Get current field offset of a result pointer</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_tell</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis> <type>int</type><varname>current_field</varname> </fieldsynopsis> </classsynopsis> <para> Returns the position of the field cursor used for the last <function>mysqli_fetch_field</function> call. This value can be used as an argument to <function>mysqli_field_seek</function>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns current offset of field cursor. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ while ($finfo = $result->fetch_field()) { /* get fieldpointer offset */ $currentfield = $result->current_field; printf("Column %d:\n", $currentfield); 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); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all fields */ while ($finfo = mysqli_fetch_field($result)) { /* get fieldpointer offset */ $currentfield = mysqli_field_tell($result); printf("Column %d:\n", $currentfield); 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); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Column 1: Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Column 2: Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_field</function></member> <member><function>mysqli_field_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/data-seek.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/data-seek.xml +++ phpdoc/en/reference/mysqli/mysqli_result/data-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-data-seek" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_data_seek</refname> <refname>result->data_seek()</refname> <refpurpose>Adjusts the result pointer to an arbitary row in the result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_data_seek</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>data_seek</methodname> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> The <function>mysqli_data_seek</function> function seeks to an arbitrary result pointer specified by the <parameter>offset</parameter> in the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; <varlistentry> <term><parameter>offset</parameter></term> <listitem> <para> The field offset. Must be between zero and the total number of rows minus one (0..<function>mysqli_num_rows</function> - 1). </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function can only be used with buffered results attained from the use of the <function>mysqli_store_result</function> or <function>mysqli_query</function> functions. </para> </note> </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 ($result = $mysqli->query( $query)) { /* seek to row no. 400 */ $result->data_seek(399); /* fetch row */ $row = $result->fetch_row(); printf ("City: %s Countrycode: %s\n", $row[0], $row[1]); /* free result set*/ $result->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 (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER BY Name"; if ($result = mysqli_query($link, $query)) { /* seek to row no. 400 */ mysqli_data_seek($result, 399); /* fetch row */ $row = mysqli_fetch_row($result); printf ("City: %s Countrycode: %s\n", $row[0], $row[1]); /* free result set*/ mysqli_free_result($result); } /* 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_store_result</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_num_rows</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-array.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-array.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-array.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-array" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_array</refname> <refname>result->fetch_array()</refname> <refpurpose>Fetch a result row as an associative, a numeric array, or both</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_fetch_array</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>mixed</type><methodname>fetch_array</methodname> <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Returns an array that corresponds to the fetched row or &null; if there are no more rows for the resultset represented by the <parameter>result</parameter> parameter. </para> <para> <function>mysqli_fetch_array</function> is an extended version of the <function>mysqli_fetch_row</function> function. In addition to storing the data in the numeric indices of the result array, the <function>mysqli_fetch_array</function> function can also store the data in associative indices, using the field names of the result set as keys. </para> &database.field-case; &database.fetch-null; <para> If two or more columns of the result have the same field names, the last column will take precedence and overwrite the earlier data. In order to access multiple columns with the same name, the numerically indexed version of the row must be used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; <varlistentry> <term><parameter>resulttype</parameter></term> <listitem> <para> This optional parameter is a constant indicating what type of array should be produced from the current row data. The possible values for this parameter are the constants <constant>MYSQLI_ASSOC</constant>, <constant>MYSQLI_NUM</constant>, or <constant>MYSQLI_BOTH</constant>. Defaults to <constant>MYSQLI_BOTH</constant>. </para> <para> By using the <constant>MYSQLI_ASSOC</constant> constant this function will behave identically to the <function>mysqli_fetch_assoc</function>, while <constant>MYSQLI_NUM</constant> will behave identically to the <function>mysqli_fetch_row</function> function. The final option <constant>MYSQLI_BOTH</constant> will create a single array with the attributes of both. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of strings that corresponds to the fetched row or &null; if there are no more rows in resultset. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID LIMIT 3"; $result = $mysqli->query($query); /* numeric array */ $row = $result->fetch_array(MYSQLI_NUM); printf ("%s (%s)\n", $row[0], $row[1]); /* associative array */ $row = $result->fetch_array(MYSQLI_ASSOC); printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); /* associative and numeric array */ $row = $result->fetch_array(MYSQLI_BOTH); printf ("%s (%s)\n", $row[0], $row["CountryCode"]); /* free result set */ $result->close(); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID LIMIT 3"; $result = mysqli_query($link, $query); /* numeric array */ $row = mysqli_fetch_array($result, MYSQLI_NUM); printf ("%s (%s)\n", $row[0], $row[1]); /* associative array */ $row = mysqli_fetch_array($result, MYSQLI_ASSOC); printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); /* associative and numeric array */ $row = mysqli_fetch_array($result, MYSQLI_BOTH); printf ("%s (%s)\n", $row[0], $row["CountryCode"]); /* free result set */ mysqli_free_result($result); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Kabul (AFG) Qandahar (AFG) Herat (AFG) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-assoc.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-assoc.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-assoc.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-assoc" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_assoc</refname> <refname>mysqli->fetch_assoc()</refname> <refpurpose>Fetch a result row as an associative array</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>array</type><methodname>mysqli_fetch_assoc</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>array</type><methodname>fetch_assoc</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Returns an associative array that corresponds to the fetched row or &null; if there are no more rows. </para> &database.field-case; &database.fetch-null; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an associative array of strings representing the fetched row in the result set, where each key in the array represents the name of one of the result set's columns or &null; if there are no more rows in resultset. </para> <para> If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by using <function>mysqli_fetch_row</function> or add alias names. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = $mysqli->query($query)) { /* fetch associative array */ while ($row = $result->fetch_assoc()) { printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); } /* free result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($row = mysqli_fetch_assoc($result)) { printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]); } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-field-direct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-field-direct.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-field-direct.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-field-direct" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_field_direct</refname> <refname>result->fetch_field_direct()</refname> <refpurpose>Fetch meta-data for a single field</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_fetch_field_direct</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>object</type><methodname>fetch_field_direct</methodname> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Returns an object which contains field definition informations from specified resultset. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <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> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object which contains field definition information or &false; if no field information for specified <literal>fieldnr</literal> is available. </para> <para> <table> <title>Object attributes</title> <tgroup cols='2'> <thead> <row> <entry>Attribute</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>name</entry> <entry>The name of the column</entry> </row> <row> <entry>orgname</entry> <entry>Original column name if an alias was specified</entry> </row> <row> <entry>table</entry> <entry>The name of the table this field belongs to (if not calculated)</entry> </row> <row> <entry>orgtable</entry> <entry>Original table name if an alias was specified</entry> </row> <row> <entry>def</entry> <entry>The default value for this field, represented as a string</entry> </row> <row> <entry>max_length</entry> <entry>The maximum width of the field for the result set.</entry> </row> <row> <entry>length</entry> <entry>The width of the field, as specified in the tabl definition.</entry> </row> <row> <entry>charsetnr</entry> <entry>The character set number for the field.</entry> </row> <row> <entry>flags</entry> <entry>An integer representing the bit-flags for the field.</entry> </row> <row> <entry>type</entry> <entry>The data type used for this field</entry> </row> <row> <entry>decimals</entry> <entry>The number of decimals used (for integer fields)</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Name LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for column 'SurfaceArea' */ $finfo = $result->fetch_field_direct(1); 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", $finfo->type); $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Name LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for column 'SurfaceArea' */ $finfo = mysqli_fetch_field_direct($result, 1); 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", $finfo->type); mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_num_fields</function></member> <member><function>mysqli_fetch_field</function></member> <member><function>mysqli_fetch_fields</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-field.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-field.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-field.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-field" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_field</refname> <refname>result->fetch_field()</refname> <refpurpose>Returns the next field in the result set</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_fetch_field</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>object</type><methodname>fetch_field</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Returns the definition of one column of a result set as an object. Call this function repeatedly to retrieve information about all columns in the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object which contains field definition information or &false; if no field information is available. </para> <para> <table> <title>Object properties</title> <tgroup cols='2'> <thead> <row> <entry>Property</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>name</entry> <entry>The name of the column</entry> </row> <row> <entry>orgname</entry> <entry>Original column name if an alias was specified</entry> </row> <row> <entry>table</entry> <entry>The name of the table this field belongs to (if not calculated)</entry> </row> <row> <entry>orgtable</entry> <entry>Original table name if an alias was specified</entry> </row> <row> <entry>def</entry> <entry>The default value for this field, represented as a string</entry> </row> <row> <entry>max_length</entry> <entry>The maximum width of the field for the result set.</entry> </row> <row> <entry>length</entry> <entry>The width of the field, as specified in the table definition.</entry> </row> <row> <entry>charsetnr</entry> <entry>The character set number for the field.</entry> </row> <row> <entry>flags</entry> <entry>An integer representing the bit-flags for the field.</entry> </row> <row> <entry>type</entry> <entry>The data type used for this field</entry> </row> <row> <entry>decimals</entry> <entry>The number of decimals used (for integer fields)</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ while ($finfo = $result->fetch_field()) { 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); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all fields */ while ($finfo = mysqli_fetch_field($result)) { 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); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_num_fields</function></member> <member><function>mysqli_fetch_field_direct</function></member> <member><function>mysqli_fetch_fields</function></member> <member><function>mysqli_field_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-fields.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-fields.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-fields.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-fields" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_fields</refname> <refname>result->fetch_fields()</refname> <refpurpose>Returns an array of objects representing the fields in a result set</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural Style:</para> <methodsynopsis> <type>array</type><methodname>mysqli_fetch_fields</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>array</type><methodname>fetch_fields</methodname> <void/> </methodsynopsis> </classsynopsis> <para> This function serves an identical purpose to the <function>mysqli_fetch_field</function> function with the single difference that, instead of returning one object at a time for each field, the columns are returned as an array of objects. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of objects which contains field definition information or &false; if no field information is available. </para> <para> <table> <title>Object properties</title> <tgroup cols='2'> <thead> <row> <entry>Property</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>name</entry> <entry>The name of the column</entry> </row> <row> <entry>orgname</entry> <entry>Original column name if an alias was specified</entry> </row> <row> <entry>table</entry> <entry>The name of the table this field belongs to (if not calculated)</entry> </row> <row> <entry>orgtable</entry> <entry>Original table name if an alias was specified</entry> </row> <row> <entry>def</entry> <entry>The default value for this field, represented as a string</entry> </row> <row> <entry>max_length</entry> <entry>The maximum width of the field for the result set.</entry> </row> <row> <entry>length</entry> <entry>The width of the field, as specified in the table definition.</entry> </row> <row> <entry>charsetnr</entry> <entry>The character set number for the field.</entry> </row> <row> <entry>flags</entry> <entry>An integer representing the bit-flags for the field.</entry> </row> <row> <entry>type</entry> <entry>The data type used for this field</entry> </row> <row> <entry>decimals</entry> <entry>The number of decimals used (for integer fields)</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ $finfo = $result->fetch_fields(); foreach ($finfo as $val) { printf("Name: %s\n", $val->name); printf("Table: %s\n", $val->table); printf("max. Len: %d\n", $val->max_length); printf("Flags: %d\n", $val->flags); printf("Type: %d\n\n", $val->type); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all columns */ $finfo = mysqli_fetch_fields($result); foreach ($finfo as $val) { printf("Name: %s\n", $val->name); printf("Table: %s\n", $val->table); printf("max. Len: %d\n", $val->max_length); printf("Flags: %d\n", $val->flags); printf("Type: %d\n\n", $val->type); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_num_fields</function></member> <member><function>mysqli_fetch_field_direct</function></member> <member><function>mysqli_fetch_field</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-object.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-object.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-object.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-object" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_object</refname> <refname>result->fetch_object()</refname> <refpurpose>Returns the current row of a result set as an object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_fetch_object</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>object</type><methodname>fetch_object</methodname> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> The <function>mysqli_fetch_object</function> will return the current row result set as an object where the attributes of the object represent the names of the fields found within the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; <varlistentry> <term><parameter>class_name</parameter></term> <listitem> <para> </para> </listitem> </varlistentry> <varlistentry> <term><parameter>params</parameter></term> <listitem> <para> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object with string properties that corresponds to the fetched row or &null; if there are no more rows in resultset. </para> &database.field-case; &database.fetch-null; </refsect1> <refsect1 role="changelog"> &reftitle.changelog; <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>5.0.0</entry> <entry> Added the ability to return as a different object. </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = $mysqli->query($query)) { /* fetch object array */ while ($obj = $result->fetch_object()) { printf ("%s (%s)\n", $obj->Name, $obj->CountryCode); } /* free result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($obj = mysqli_fetch_object($result)) { printf ("%s (%s)\n", $obj->Name, $obj->CountryCode); } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_row</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/fetch-row.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/fetch-row.xml +++ phpdoc/en/reference/mysqli/mysqli_result/fetch-row.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-row" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_row</refname> <refname>result->fetch_row()</refname> <refpurpose>Get a result row as an enumerated array</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_fetch_row</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>mixed</type><methodname>fetch_row</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Fetches one row of data from the result set and returns it as an enumerated array, where each column is stored in an array offset starting from 0 (zero). Each subsequent call to this function will return the next row within the result set, or &null; if there are no more rows. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> <function>mysqli_fetch_row</function> returns an array of strings that corresponds to the fetched row or &null; if there are no more rows in result set. </para> &database.fetch-null; </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = $mysqli->query($query)) { /* fetch object array */ while ($row = $result->fetch_row()) { printf ("%s (%s)\n", $row[0], $row[1]); } /* free result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 ID DESC LIMIT 50,5"; if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($row = mysqli_fetch_row($result)) { printf ("%s (%s)\n", $row[0], $row[1]); } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_array</function></member> <member><function>mysqli_fetch_assoc</function></member> <member><function>mysqli_fetch_object</function></member> <member><function>mysqli_query</function></member> <member><function>mysqli_data_seek</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/field-count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/field-count.xml +++ phpdoc/en/reference/mysqli/mysqli_result/field-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-num-fields" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_num_fields</refname> <refname>result->field_count</refname> <refpurpose>Get the number of fields in a result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_num_fields</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>int</type><varname>field_count</varname></fieldsynopsis> </classsynopsis> <para> Returns the number of fields from specified result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The number of fields from a result set. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = $mysqli->query("SELECT * FROM City ORDER BY ID LIMIT 1")) { /* determine number of fields in result set */ $field_cnt = $result->field_count; printf("Result set has %d fields.\n", $field_cnt); /* close result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = mysqli_query($link, "SELECT * FROM City ORDER BY ID LIMIT 1")) { /* determine number of fields in result set */ $field_cnt = mysqli_num_fields($result); printf("Result set has %d fields.\n", $field_cnt); /* close result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Result set has 5 fields. ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_field</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/field-seek.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/field-seek.xml +++ phpdoc/en/reference/mysqli/mysqli_result/field-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-field-seek" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_field_seek</refname> <refname>result->field_seek()</refname> <refpurpose>Set result pointer to a specified field offset</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>field_seek</methodname> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> 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. </para> <note> <para> To seek to the beginning of a row, pass an offset value of zero. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <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> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the previous value of field cursor. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for 2nd column */ $result->field_seek(1); $finfo = $result->fetch_field(); 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); $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for 2nd column */ mysqli_field_seek($result, 1); $finfo = mysqli_fetch_field($result); 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); mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_fetch_field</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/free.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/free.xml +++ phpdoc/en/reference/mysqli/mysqli_result/free.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-free-result" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_free_result</refname> <refname>result->free()</refname> <refpurpose>Frees the memory associated with a result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>void</type><methodname>mysqli_free_result</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (all methods are equivalent):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <methodsynopsis> <type>void</type><methodname>free</methodname> <void /> </methodsynopsis> <methodsynopsis> <type>void</type><methodname>close</methodname> <void /> </methodsynopsis> <methodsynopsis> <type>void</type><methodname>free_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Frees the memory associated with the result. </para> <note> <para> You should always free your result with <function>mysqli_free_result</function>, when your result object is not needed anymore. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.void; </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_query</function></member> <member><function>mysqli_stmt_store_result</function></member> <member><function>mysqli_store_result</function></member> <member><function>mysqli_use_result</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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/lengths.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/lengths.xml +++ phpdoc/en/reference/mysqli/mysqli_result/lengths.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-fetch-lengths" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_fetch_lengths</refname> <refname>result->lengths()</refname> <refpurpose>Returns the lengths of the columns of the current row in the result set</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>array</type><methodname>mysqli_fetch_lengths</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>array</type><varname>lengths</varname></fieldsynopsis> </classsynopsis> <para> The <function>mysqli_fetch_lengths</function> function returns an array containing the lengths of every column of the current row within the result set. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An array of integers representing the size of each column (not including any terminating null characters). &false; if an error occurred. </para> <para> <function>mysqli_fetch_lengths</function> is valid only for the current row of the result set. It returns &false; if you call it before calling mysqli_fetch_row/array/object or after retrieving all rows in the result. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $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 * from Country ORDER BY Code LIMIT 1"; if ($result = $mysqli->query($query)) { $row = $result->fetch_row(); /* display column lengths */ foreach ($result->lengths as $i => $val) { printf("Field %2d has Length %2d\n", $i+1, $val); } $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $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 * from Country ORDER BY Code LIMIT 1"; if ($result = mysqli_query($link, $query)) { $row = mysqli_fetch_row($result); /* display column lengths */ foreach (mysqli_fetch_lengths($result) as $i => $val) { printf("Field %2d has Length %2d\n", $i+1, $val); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Field 1 has Length 3 Field 2 has Length 5 Field 3 has Length 13 Field 4 has Length 9 Field 5 has Length 6 Field 6 has Length 1 Field 7 has Length 6 Field 8 has Length 4 Field 9 has Length 6 Field 10 has Length 6 Field 11 has Length 5 Field 12 has Length 44 Field 13 has Length 7 Field 14 has Length 3 Field 15 has Length 2 ]]> </screen> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli_result/num-rows.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli_result/num-rows.xml +++ phpdoc/en/reference/mysqli/mysqli_result/num-rows.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-num-rows" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_num_rows</refname> <refname>result->num_rows</refname> <refpurpose>Gets the number of rows in a result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_num_rows</methodname> <methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>int</type><varname>num_rows</varname></fieldsynopsis> </classsynopsis> <para> Returns the number of rows in the result set. </para> <para> The use of <function>mysqli_num_rows</function> depends on whether you use buffered or unbuffered result sets. In case you use unbuffered resultsets <function>mysqli_num_rows</function> will not correct the correct number of rows until all the rows in the result have been retrieved. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.result.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns number of rows in the result set. </para> <note> <para> If the number of rows is greater than maximal int value, the number will be returned as a string. </para> </note> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = $mysqli->query("SELECT Code, Name FROM Country ORDER BY Name")) { /* determine number of rows result set */ $row_cnt = $result->num_rows; printf("Result set has %d rows.\n", $row_cnt); /* close result set */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($result = mysqli_query($link, "SELECT Code, Name FROM Country ORDER BY Name")) { /* determine number of rows result set */ $row_cnt = mysqli_num_rows($result); printf("Result set has %d rows.\n", $row_cnt); /* close result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Result set has 239 rows. ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_affected_rows</function></member> <member><function>mysqli_store_result</function></member> <member><function>mysqli_use_result</function></member> <member><function>mysqli_query</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 -->