cvs: peardoc /en/package/database/mdb2 intro-fetch.xml
| From: | Lukas Smith | Date: | Mon, 07 Aug 2006 12:58:52 +0000 |
| Subject: | cvs: peardoc /en/package/database/mdb2 intro-fetch.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-8264@lists.php.net to get a copy of this message | ||
lsmith Mon Aug 7 12:58:52 2006 UTC
Modified files:
/peardoc/en/package/database/mdb2 intro-fetch.xml
Log:
- really added documentation for seek()
http://cvs.php.net/viewvc.cgi/peardoc/en/package/database/mdb2/intro-fetch.xml?r1=1.11&r2=1.12&diff_format=u
Index: peardoc/en/package/database/mdb2/intro-fetch.xml
diff -u peardoc/en/package/database/mdb2/intro-fetch.xml:1.11
peardoc/en/package/database/mdb2/intro-fetch.xml:1.12
--- peardoc/en/package/database/mdb2/intro-fetch.xml:1.11 Mon Aug 7 11:17:31 2006
+++ peardoc/en/package/database/mdb2/intro-fetch.xml Mon Aug 7 12:58:52 2006
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<!--
todos:
add information on the following methods:
-seek(), getResource(), bindColumn(), setResultTypes() and nextResult()
+getResource(), bindColumn(), setResultTypes(), nextResult()
add information about custom result classes and wrappers
@@ -352,7 +352,28 @@
<?php
// Once you have a valid MDB2 object named $mdb2...
$res =& $mdb2->query('SELECT * FROM phptest');
-print_r($res->getColumnNames($res));
+print_r($res->getColumnNames());
+
+?>
+ ]]>
+ </programlisting>
+ </example>
+
+ <example>
+ <title>
+ <ulink url="http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Result_Common.html#methodseek">
+ <function>seek</function></ulink> allows to seek to a specific row inside
+ a result set. Note that seeking to previously read rows is only possible
+ if the 'result_buffering' option is left enabled, otherwise only forward
+ seeking is supported.
+ </title>
+ <programlisting role="php">
+ <![CDATA[
+<?php
+// Once you have a valid MDB2 object named $mdb2...
+$res =& $mdb2->query('SELECT * FROM phptest');
+// Seek to the 10th row in the result set
+$res->seek(10));
?>
]]>