georg           Sun Feb 22 04:40:50 2004 EDT

  Modified files:              
    /phpdoc/en/reference/mysqli/functions       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-fetch.xml 
                                                mysqli-field-count.xml 
                                                mysqli-field-seek.xml 
                                                mysqli-field-tell.xml 
  Log:
  added more samples
  
  
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-field-direct.xml?r1=1.4&r2=1.5&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-field-direct.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-field-direct.xml:1.4 
phpdoc/en/reference/mysqli/functions/mysqli-fetch-field-direct.xml:1.5
--- phpdoc/en/reference/mysqli/functions/mysqli-fetch-field-direct.xml:1.4      Sat 
Feb 21 03:44:40 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-field-direct.xml  Sun Feb 22 
04:40:50 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
   <refentry id="function.mysqli-fetch-field-direct">
    <refnamediv>
     <refname>mysqli_fetch_field_direct</refname>
@@ -37,6 +37,57 @@
      Returns an object which contains field definition informations 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>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>
     <title>See also</title>
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml?r1=1.6&r2=1.7&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.6 
phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.7
--- phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.6     Wed Jan 28 
18:18:42 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml Sun Feb 22 04:40:50 
2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
   <refentry id="function.mysqli-fetch-field">
    <refnamediv>
     <refname>mysqli_fetch_field</refname>
@@ -29,6 +29,13 @@
      the attributes of the current column or &false; if there are no more columns in 
the
      result set.
     </para>
+   </refsect1>
+   <refsect1>
+    <title>Return values</title>
+    <para>
+     Returns an object which contains field definition informations or &false; if no 
field information
+     is available.
+    </para>
     <para>
     <table>
      <title>Object attributes</title>
@@ -82,20 +89,81 @@
     </para>
    </refsect1>
    <refsect1>
-    <title>Return values</title>
-    <para>
-     Returns an object which contains field definition informations or &false; if no 
field information
-     is available.
-    </para>
-   </refsect1>
-   <refsect1>
     <title>See also</title>
     <para>
      <function>mysqli_num_fields</function>
      <function>mysqli_fetch_field_direct</function>
      <function>mysqli_fetch_fields</function>
+     <function>mysqli_field_seek</function>
     </para>
-   </refsect1>    
+   </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = $mysqli->query( "SELECT id, name FROM friends");
+
+/* Get field information for all columns */
+while ($finfo = $result->fetch_field()) {
+    printf("Name:     %s\n", $finfo->name);
+    printf("Table:    %s\n", $finfo->table);
+    printf("Default:  %s\n", $finfo->def);
+    printf("max. Len: %d\n", $finfo->max_length);
+    printf("Flags:    %d\n", $finfo->flags);
+    printf("Type:     %d\n", $finfo->type);
+}
+ 
+$result->close();
+
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = mysqli_query($link, "SELECT id, name FROM friends");
+
+/* Get field information for all columns */
+while ($finfo = mysqli_fetch_field($result)) {
+    printf("Name:     %s\n", $finfo->name);
+    printf("Table:    %s\n", $finfo->table);
+    printf("Default:  %s\n", $finfo->def);
+    printf("max. Len: %d\n", $finfo->max_length);
+    printf("Flags:    %d\n", $finfo->flags);
+    printf("Type:     %d\n", $finfo->type);
+}
+
+mysqli_free_result($result);
+
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml?r1=1.6&r2=1.7&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.6 
phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.7
--- phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.6    Wed Jan 28 
18:18:42 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml        Sun Feb 22 
04:40:50 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
   <refentry id="function.mysqli-fetch-fields">
    <refnamediv>
     <refname>mysqli_fetch_fields</refname>
@@ -36,6 +36,57 @@
      Returns an array of objects which contains field definition informations or 
&false; if no field information
      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>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>
     <title>See also</title>
@@ -45,6 +96,77 @@
      <function>mysqli_fetch_field_direct</function>
     </para>
    </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = mysqli_query($link, "SELECT id, name FROM friends");
+
+/* Get field informations */
+$finfo = mysqli_fetch_fields($result);
+
+for ($i=0; $i < count($finfo); $i++) {
+    printf("Name:     %s\n", $finfo[$i]->name);
+    printf("Table:    %s\n", $finfo[$i]->table);
+    printf("Default:  %s\n", $finfo[$i]->def);
+    printf("max. Len: %d\n", $finfo[$i]->max_length);
+    printf("Flags:    %d\n", $finfo[$i]->flags);
+    printf("Type:     %d\n", $finfo[$i]->type);
+}
+
+mysqli_free_result($result);
+
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = $mysqli->query( "SELECT id, name FROM friends");
+
+/* Get field information for column 'name' */
+$finfo = $result->fetch_fields();
+
+for ($i=0; $i < count($finfo); $i++) {
+    printf("Name:     %s\n", $finfo[$i]->name);
+    printf("Table:    %s\n", $finfo[$i]->table);
+    printf("Default:  %s\n", $finfo[$i]->def);
+    printf("max. Len: %d\n", $finfo[$i]->max_length);
+    printf("Flags:    %d\n", $finfo[$i]->flags);
+    printf("Type:     %d\n", $finfo[$i]->type);
+}
+ 
+$result->close();
+
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml?r1=1.7&r2=1.8&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.7 
phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.8
--- phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.7   Sat Feb  7 
14:02:48 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml       Sun Feb 22 
04:40:50 2004
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
+<!-- $Revision: 1.8 $ -->
   <refentry id="function.mysqli-fetch-lengths">
    <refnamediv>
     <refname>mysqli_fetch_lengths</refname>
-    <refname>result->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>
@@ -16,7 +16,7 @@
     <para>Object oriented style (property):</para>
     <classsynopsis>
      <ooclass><classname>result</classname></ooclass>
-     <fieldsynopsis><type>mixed</type><varname>fetch_lengths</varname></fieldsynopsis>
+     <fieldsynopsis><type>mixed</type><varname>lengths</varname></fieldsynopsis>
     </classsynopsis>
     <para>
      The <function>mysqli_fetch_lengths</function> function returns an array 
containing the
@@ -37,6 +37,69 @@
      all rows in the result. 
     </para>
    </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = $mysqli->query( "SELECT id, name FROM friends");
+
+$row = $result->fetch_row();
+
+/* Print field lengths */
+for ($i=0; $i < count($result->lengths); $i++) {
+    printf("Field %d has length %d\n", $i, $result->lengths[$i]);
+}
+
+$result->close();
+
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = mysqli_query($link, "SELECT id, name FROM friends");
+
+$row = mysqli_fetch_row($result);
+
+/* Get field lengths */
+$lengths = mysqli_fetch_lengths($result);
+
+for ($i=0; $i < count($lengths); $i++) {
+    printf("Field %d has length %d\n", $i, $lengths[$i]);
+}
+
+mysqli_free_result($result);
+
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml?r1=1.7&r2=1.8&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.7 
phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.8
--- phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.7    Wed Jan 28 
18:18:42 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml        Sun Feb 22 
04:40:50 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
+<!-- $Revision: 1.8 $ -->
   <refentry id="function.mysqli-fetch-object">
    <refnamediv>
     <refname>mysqli_fetch_object</refname>
@@ -31,7 +31,7 @@
    <refsect1>
     <title>Return values</title>
     <para>
-     Returns an object or &false; if an error occured.
+     Returns an object that corresponds to the fetched row or &null; if there are no 
more rows in resultset.
     </para>
     &database.field-case;
    </refsect1>
@@ -43,6 +43,61 @@
      <function>mysqli_fetch_row</function>.
     </para>
    </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = mysqli_query($link, "SELECT id, name FROM friends");
+
+/* fetch object */
+$obj = mysqli_fetch_object($result);
+
+printf("Id: %d Name: %s\n", $obj->id, $obj->name);
+
+mysqli_free_result($result);
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = $mysqli->query( "SELECT id, name FROM friends");
+
+/* fetch object */
+$obj = $result->fetch_object();
+
+printf("Id: %d Name: %s\n", $obj->id, $obj->name);
+
+$result->close();
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml?r1=1.6&r2=1.7&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.6 
phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.7
--- phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.6       Thu Jan 29 
06:39:03 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml   Sun Feb 22 04:40:50 
2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
   <refentry id="function.mysqli-fetch-row">
    <refnamediv>
     <refname>mysqli_fetch_row</refname>
@@ -37,7 +37,7 @@
     <title>Return values</title>
     <para>
      <function>mysqli_fetch_row</function> returns an array that corresponds to the 
fetched row
-     or &false; if there are no more rows in result set.
+     or &null; if there are no more rows in result set.
     </para>
    </refsect1>
    <refsect1>
@@ -48,6 +48,61 @@
      <function>mysqli_fetch_object</function>.
     </para>
    </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = $mysqli->query( "SELECT id, name FROM friends");
+
+/* fetch object */
+$row = $result->fetch_row();
+
+printf("Id: %d Name: %s\n", $row[0], $row[1]);
+
+$result->close();
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = mysqli_query($link, "SELECT id, name FROM friends");
+
+/* fetch object */
+$row = mysqli_fetch_row($result);
+
+printf("Id: %d Name: %s\n", $row[0], $row[1]);
+
+mysqli_free_result($result);
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml?r1=1.4&r2=1.5&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.4 
phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.5
--- phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.4   Wed Feb 18 08:28:28 
2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml       Sun Feb 22 04:40:50 
2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
   <refentry id="function.mysqli-fetch">
    <refnamediv>
     <refname>mysqli_fetch</refname>
@@ -70,6 +70,73 @@
      <function>mysqli_bind_result</function>
     </para>
    </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$stmt = $mysqli->prepare( "SELECT id, name FROM friends");
+
+/* execute statement */
+$stmt->execute();
+
+/* bind result variables */
+$stmt->bind_result($column1, $column2);
+
+/* fetch result */
+while ($stmt->fetch()) {
+    printf("Id: %d Name: %s\n", $column1, $column2);
+}
+
+$stmt->close();
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$stmt = mysqli_prepare($link, "SELECT id, name FROM friends");
+
+/* execute statement */
+mysqli_execute($stmt);
+
+/* bind result variables */
+mysqli_bind_result($stmt, $column1, $column2);
+
+/* fetch result */
+while (mysqli_fetch($stmt)) {
+    printf("Id: %d Name: %s\n", $column1, $column2);
+}
+
+mysqli_stmt_close($stmt);
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-field-count.xml?r1=1.5&r2=1.6&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-field-count.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-field-count.xml:1.5 
phpdoc/en/reference/mysqli/functions/mysqli-field-count.xml:1.6
--- phpdoc/en/reference/mysqli/functions/mysqli-field-count.xml:1.5     Wed Jan 28 
18:18:42 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-field-count.xml Sun Feb 22 04:40:50 
2004
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
   <refentry id="function.mysqli-field-count">
    <refnamediv>
     <refname>mysqli_field_count</refname>
-    <refname>mysql->field_cont</refname>
+    <refname>mysql->field_count</refname>
     <refpurpose>Returns the number of columns for the most recent query</refpurpose>
    </refnamediv>
    <refsect1>
@@ -34,6 +34,74 @@
     <title>Return values</title>
     <para>An integer representing the number of fields in a result set</para>
    </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+
+$mysqli->real_query($HTTP_POST_VARS['query']);
+
+if (mysql_field_count($link)) {
+    /* this was a select/show or describe query */
+    $result = $mysqli->store_result();
+    
+    /* process resultset */
+    $row = $result->fetch_row();
+
+    /* free resultset */
+    $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", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+mysqli_real_query($link, $HTTP_POST_VARS['query']);
+
+if (mysql_field_count($link)) {
+    /* this was a select/show or describe query */
+    $result = mysqli_store_result($link);
+    
+    /* process resultset */
+    $row = mysqli_fetch_row($result);
+
+    /* free resultset */
+    mysqli_free_result($result);
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-field-seek.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-field-seek.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-field-seek.xml:1.3 
phpdoc/en/reference/mysqli/functions/mysqli-field-seek.xml:1.4
--- phpdoc/en/reference/mysqli/functions/mysqli-field-seek.xml:1.3      Wed Jan 28 
18:18:42 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-field-seek.xml  Sun Feb 22 04:40:50 
2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
   <refentry id="function.mysqli-field-seek">
    <refnamediv>
     <refname>mysqli_field_seek</refname>
@@ -39,6 +39,84 @@
      <function>mysqli_field_seek</function> returns previuos value of field cursor.
     </para>
    </refsect1>
+   <refsect1>
+    <title>See also</title>
+    <para>
+     <function>mysqli_fetch_field</function>
+    </para>
+   </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = $mysqli->query( "SELECT id, name FROM friends");
+
+/* set field pointer to column name */
+$result->field_seek(1);
+
+/* fetch field information */
+$finfo = $result->fetch_field();
+printf("Name:     %s\n", $finfo->name);
+printf("Table:    %s\n", $finfo->table);
+printf("Default:  %s\n", $finfo->def);
+printf("max. Len: %d\n", $finfo->max_length);
+printf("Flags:    %d\n", $finfo->flags);
+printf("Type:     %d\n", $finfo->type);
+ 
+$result->close();
+
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = mysqli_query($link, "SELECT id, name FROM friends");
+
+/* set field pointer to column name */
+mysqli_field_seek($result, 1);
+
+/* fetch field information */
+$finfo = mysqli_fetch_field($result);
+
+printf("Name:     %s\n", $finfo->name);
+printf("Table:    %s\n", $finfo->table);
+printf("Default:  %s\n", $finfo->def);
+printf("max. Len: %d\n", $finfo->max_length);
+printf("Flags:    %d\n", $finfo->flags);
+printf("Type:     %d\n", $finfo->type);
+
+mysqli_free_result($result);
+
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-field-tell.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-field-tell.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-field-tell.xml:1.3 
phpdoc/en/reference/mysqli/functions/mysqli-field-tell.xml:1.4
--- phpdoc/en/reference/mysqli/functions/mysqli-field-tell.xml:1.3      Wed Jan 28 
18:18:42 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-field-tell.xml  Sun Feb 22 04:40:50 
2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
   <refentry id="function.mysqli-field-tell">
    <refnamediv>
     <refname>mysqli_field_tell</refname>
@@ -42,6 +42,78 @@
      <function>mysqli_field_seek</function>
     </para>
    </refsect1>
+   <refsect1>
+    <title>Example</title>
+    <para>
+     <example>
+      <title>Object oriented style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+$mysqli->query( "DROP TABLE IF EXISTS friends"); 
+$mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+$mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = $mysqli->query( "SELECT id, name FROM friends");
+
+while ($finfo = mysqli_fetch_field($result)) {
+    /* get field pointer position */
+    $fieldnr = mysqli_field_tell($result);
+    printf("Fieldnr: %d\n", $fieldnr);
+
+    printf("Name:     %s\n", $finfo->name);
+    printf("Table:    %s\n", $finfo->table);
+    printf("Default:  %s\n", $finfo->def);
+    printf("max. Len: %d\n", $finfo->max_length);
+    printf("Flags:    %d\n", $finfo->flags);
+    printf("Type:     %d\n", $finfo->type);
+}
+ 
+$result->close();
+
+$mysqli->close();
+?>
+]]>
+      </programlisting>
+     </example>
+     <example>
+      <title>Procedural style</title>
+      <programlisting role='php'>
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+mysqli_query($link, "DROP TABLE IF EXISTS friends"); 
+mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); 
+ 
+mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
+
+$result = mysqli_query($link, "SELECT id, name FROM friends");
+
+while ($finfo = $result->fetch_field()) {
+    /* get field pointer position */
+    $fieldnr = $result->current_field;
+    printf("Fieldnr: %d\n", $fieldnr);
+    printf("Name:     %s\n", $finfo->name);
+    printf("Table:    %s\n", $finfo->table);
+    printf("Default:  %s\n", $finfo->def);
+    printf("max. Len: %d\n", $finfo->max_length);
+    printf("Flags:    %d\n", $finfo->flags);
+    printf("Type:     %d\n", $finfo->type);
+}
+
+mysqli_free_result($result);
+
+mysqli_close($link);
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
+   </refsect1>
   </refentry>
 
 <!-- Keep this comment at the end of the file

Reply via email to