cvs: peardoc /en/package/database/mdb2 intro-fetch.xml

From: Date: Sat, 12 Aug 2006 10:24:26 +0000
Subject: cvs: peardoc /en/package/database/mdb2 intro-fetch.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8285@lists.php.net to get a copy of this message
lsmith Sat Aug 12 10:24:26 2006 UTC Modified files: /peardoc/en/package/database/mdb2 intro-fetch.xml Log: - add documentation for nextResult() - there is already documentaiton for setResultTypes() http://cvs.php.net/viewvc.cgi/peardoc/en/package/database/mdb2/intro-fetch.xml?r1=1.15&r2=1.16&diff_format=u Index: peardoc/en/package/database/mdb2/intro-fetch.xml diff -u peardoc/en/package/database/mdb2/intro-fetch.xml:1.15 peardoc/en/package/database/mdb2/intro-fetch.xml:1.16 --- peardoc/en/package/database/mdb2/intro-fetch.xml:1.15 Fri Aug 11 13:04:09 2006 +++ peardoc/en/package/database/mdb2/intro-fetch.xml Sat Aug 12 10:24:26 2006 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.15 $ --> +<!-- $Revision: 1.16 $ --> <!-- todos: add information on the following methods: -bindColumn(), setResultTypes(), nextResult() +bindColumn() add information about custom result classes and wrappers @@ -407,6 +407,33 @@ ]]> </programlisting> </example> + + <example> + <title> + <ulink url="http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Result_Common.html#methodnextResult"> + <function>nextResult</function></ulink> allows iterate over multiple + results returned by a multi query. + </title> + <programlisting role="php"> + <![CDATA[ +<?php +// Once you have a valid MDB2 object named $mdb2... +$multi_query = $this->db->setOption('multi_query', true); +// check if multi_query can be enabled +if (!PEAR::isError($multi_query)) { + $res =& $mdb2->query('SELECT * FROM phptest; SELECT * FROM phptest2;'); + $data1 = $res->fetchAll(); + // move result pointer to the next result + $res->nextResult(); + $data2 = $res->fetchAll(); +} else { + echo 'multi_query option is not supported'; +} + +?> + ]]> + </programlisting> + </example> </refsect2> <refsect2 id="package.database.mdb2.intro-fetch.desc.convinience">

« previous php.pear.doc (#8285) next »