svn: /phpdoc/en/trunk/ appendices/migration54.xml reference/mysqli/mysqli_result/fetch-assoc.xml reference/mysqli/mysqli_result.xml

From: Date: Fri, 09 Dec 2011 03:47:42 +0000
Subject: svn: /phpdoc/en/trunk/ appendices/migration54.xml reference/mysqli/mysqli_result/fetch-assoc.xml reference/mysqli/mysqli_result.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9192@lists.php.net to get a copy of this message
philip Fri, 09 Dec 2011 03:47:42 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=320713 Log: Documented 5.4+ MySQLi_Result iterator support Changed paths: U phpdoc/en/trunk/appendices/migration54.xml U phpdoc/en/trunk/reference/mysqli/mysqli_result/fetch-assoc.xml U phpdoc/en/trunk/reference/mysqli/mysqli_result.xml Modified: phpdoc/en/trunk/appendices/migration54.xml =================================================================== --- phpdoc/en/trunk/appendices/migration54.xml 2011-12-09 03:41:02 UTC (rev 320712) +++ phpdoc/en/trunk/appendices/migration54.xml 2011-12-09 03:47:42 UTC (rev 320713) @@ -426,6 +426,12 @@ <itemizedlist> <listitem> <simpara> + <classname>MySQLi_Result</classname> now implements + <classname>Traversable</classname>. + </simpara> + </listitem> + <listitem> + <simpara> <!-- Placeholder for "Changes in extension behaviour, and new features". --> <!-- Example Modified: phpdoc/en/trunk/reference/mysqli/mysqli_result/fetch-assoc.xml =================================================================== --- phpdoc/en/trunk/reference/mysqli/mysqli_result/fetch-assoc.xml 2011-12-09 03:41:02 UTC (rev 320712) +++ phpdoc/en/trunk/reference/mysqli/mysqli_result/fetch-assoc.xml 2011-12-09 03:47:42 UTC (rev 320713) @@ -125,6 +125,46 @@ ]]> </screen> </example> + <example xml:id="mysqli-result.example.iterator"> + <title>A <classname>MySQLi_Result</classname> example comparing <classname>iterator</classname> usage</title> + <programlisting role="php"> +<![CDATA[ +<?php +$c = mysqli_connect('127.0.0.1','user', 'pass'); + +// Using iterators (support was added with PHP 5.4) +foreach ( $c->query('SELECT user,host FROM mysql.user') as $row ) { + printf("'%s'@'%s'\n", $row['user'], $row['host']); +} + +echo "\n==================\n"; + +// Not using iterators +$result = $c->query('SELECT user,host FROM mysql.user'); +while ($row = $result->fetch_assoc()) { + printf("'%s'@'%s'\n", $row['user'], $row['host']); +} + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +'root'@'192.168.1.1' +'root'@'127.0.0.1' +'dude'@'localhost' +'lebowski'@'localhost' + +================== + +'root'@'192.168.1.1' +'root'@'127.0.0.1' +'dude'@'localhost' +'lebowski'@'localhost' +]]> + </screen> + </example> </refsect1> <refsect1 role="seealso"> Modified: phpdoc/en/trunk/reference/mysqli/mysqli_result.xml =================================================================== --- phpdoc/en/trunk/reference/mysqli/mysqli_result.xml 2011-12-09 03:41:02 UTC (rev 320712) +++ phpdoc/en/trunk/reference/mysqli/mysqli_result.xml 2011-12-09 03:47:42 UTC (rev 320713) @@ -12,6 +12,32 @@ <para> Represents the result set obtained from a query against the database. </para> + + <para> + <emphasis role="bold">&Changelog;</emphasis> + </para> + + <table> + <title>&Changelog;</title> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.4.0</entry> + <entry> + <classname>Iterator</classname> support was added, as <classname>MySQLi_Result</classname> + now implements <classname>Traversable</classname>. + </entry> + </row> + </tbody> + </tgroup> + </table> + </section> <!-- }}} --> @@ -27,6 +53,11 @@ <ooclass> <classname>MySQLi_Result</classname> </ooclass> + + <oointerface> + <interfacename>Traversable</interfacename> + </oointerface> + </classsynopsisinfo> <!-- }}} -->

« previous php.doc.cvs (#9192) next »