cvs: peardoc /en/package/database/db/db-result fetchinto.xml fetchrow.xml free.xml numcols.xml numrows.xml
| From: | Daniel Convissor | Date: | Tue, 13 Apr 2004 19:14:08 +0000 |
| Subject: | cvs: peardoc /en/package/database/db/db-result fetchinto.xml fetchrow.xml free.xml numcols.xml numrows.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-3365@lists.php.net to get a copy of this message | ||
danielc Tue Apr 13 15:14:08 2004 EDT
Modified files:
/peardoc/en/package/database/db/db-result fetchinto.xml
fetchrow.xml free.xml
numcols.xml numrows.xml
Log:
Add example.
http://cvs.php.net/diff.php/peardoc/en/package/database/db/db-result/fetchinto.xml?r1=1.14&r2=1.15&ty=u
Index: peardoc/en/package/database/db/db-result/fetchinto.xml
diff -u peardoc/en/package/database/db/db-result/fetchinto.xml:1.14
peardoc/en/package/database/db/db-result/fetchinto.xml:1.15
--- peardoc/en/package/database/db/db-result/fetchinto.xml:1.14 Tue Apr 13 14:55:00 2004
+++ peardoc/en/package/database/db/db-result/fetchinto.xml Tue Apr 13 15:14:08 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.14 $ -->
+<!-- $Revision: 1.15 $ -->
<refentry id="package.database.db.db-result.fetchinto">
<refnamediv>
@@ -94,6 +94,24 @@
<function>fetchRow</function></link>
</para>
</refsect1>
+
+ <refsect1 id="package.database.db.db-result.fetchinto.example">
+ &title.example;
+ <example>
+ <title>Using <function>fetchInto</function></title>
+ <programlisting role="php">
+ <![CDATA[
+<?php
+// Once you have a valid DB object named $db...
+$res =& $db->query('SELECT * FROM mytable');
+while ($res->fetchInto($row)) {
+ echo $row[0] . "\n";
+}
+?>
+ ]]>
+ </programlisting>
+ </example>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/peardoc/en/package/database/db/db-result/fetchrow.xml?r1=1.15&r2=1.16&ty=u
Index: peardoc/en/package/database/db/db-result/fetchrow.xml
diff -u peardoc/en/package/database/db/db-result/fetchrow.xml:1.15
peardoc/en/package/database/db/db-result/fetchrow.xml:1.16
--- peardoc/en/package/database/db/db-result/fetchrow.xml:1.15 Tue Apr 13 14:55:01 2004
+++ peardoc/en/package/database/db/db-result/fetchrow.xml Tue Apr 13 15:14:08 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.15 $ -->
+<!-- $Revision: 1.16 $ -->
<refentry id="package.database.db.db-result.fetchrow">
<refnamediv>
@@ -79,6 +79,24 @@
<function>fetchInto</function></link>
</para>
</refsect1>
+
+ <refsect1 id="package.database.db.db-result.fetchrow.example">
+ &title.example;
+ <example>
+ <title>Using <function>fetchRow</function></title>
+ <programlisting role="php">
+ <![CDATA[
+<?php
+// Once you have a valid DB object named $db...
+$res =& $db->query('SELECT * FROM mytable');
+while ($row =& $res->fetchRow()) {
+ echo $row[0] . "\n";
+}
+?>
+ ]]>
+ </programlisting>
+ </example>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/peardoc/en/package/database/db/db-result/free.xml?r1=1.13&r2=1.14&ty=u
Index: peardoc/en/package/database/db/db-result/free.xml
diff -u peardoc/en/package/database/db/db-result/free.xml:1.13
peardoc/en/package/database/db/db-result/free.xml:1.14
--- peardoc/en/package/database/db/db-result/free.xml:1.13 Tue Apr 13 14:55:01 2004
+++ peardoc/en/package/database/db/db-result/free.xml Tue Apr 13 15:14:08 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.13 $ -->
+<!-- $Revision: 1.14 $ -->
<refentry id="package.database.db.db-result.free">
<refnamediv>
@@ -40,6 +40,25 @@
&title.note;
¬e.notstatic;
</refsect1>
+
+ <refsect1 id="package.database.db.db-result.free.example">
+ &title.example;
+ <example>
+ <title>Using <function>free</function></title>
+ <programlisting role="php">
+ <![CDATA[
+<?php
+// Once you have a valid DB object named $db...
+$res =& $db->query('SELECT name, address FROM clients');
+while ($row =& $res->fetchRow()) {
+ echo $row['name'] . ', ' . $row['address'] . "\n";
+}
+$res->free();
+?>
+ ]]>
+ </programlisting>
+ </example>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/peardoc/en/package/database/db/db-result/numcols.xml?r1=1.13&r2=1.14&ty=u
Index: peardoc/en/package/database/db/db-result/numcols.xml
diff -u peardoc/en/package/database/db/db-result/numcols.xml:1.13
peardoc/en/package/database/db/db-result/numcols.xml:1.14
--- peardoc/en/package/database/db/db-result/numcols.xml:1.13 Tue Apr 13 14:55:01 2004
+++ peardoc/en/package/database/db/db-result/numcols.xml Tue Apr 13 15:14:08 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.13 $ -->
+<!-- $Revision: 1.14 $ -->
<refentry id="package.database.db.db-result.numcols">
<refnamediv>
@@ -40,6 +40,22 @@
<function>numRows</function></link>
</para>
</refsect1>
+
+ <refsect1 id="package.database.db.db-result.numcols.example">
+ &title.example;
+ <example>
+ <title>Using <function>numCols</function></title>
+ <programlisting role="php">
+ <![CDATA[
+<?php
+// Once you have a valid DB object named $db...
+$res =& $db->query('SELECT * FROM phptest');
+echo $res->numCols();
+?>
+ ]]>
+ </programlisting>
+ </example>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/peardoc/en/package/database/db/db-result/numrows.xml?r1=1.14&r2=1.15&ty=u
Index: peardoc/en/package/database/db/db-result/numrows.xml
diff -u peardoc/en/package/database/db/db-result/numrows.xml:1.14
peardoc/en/package/database/db/db-result/numrows.xml:1.15
--- peardoc/en/package/database/db/db-result/numrows.xml:1.14 Tue Apr 13 14:55:01 2004
+++ peardoc/en/package/database/db/db-result/numrows.xml Tue Apr 13 15:14:08 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.14 $ -->
+<!-- $Revision: 1.15 $ -->
<refentry id="package.database.db.db-result.numrows">
<refnamediv>
@@ -40,6 +40,22 @@
<function>numCols</function></link>
</para>
</refsect1>
+
+ <refsect1 id="package.database.db.db-result.numrows.example">
+ &title.example;
+ <example>
+ <title>Using <function>numRows</function></title>
+ <programlisting role="php">
+ <![CDATA[
+<?php
+// Once you have a valid DB object named $db...
+$res =& $db->query('SELECT * FROM phptest');
+echo $res->numRows();
+?>
+ ]]>
+ </programlisting>
+ </example>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file