php-doc-en/reference/mysqlnd_uh/mysqlnduhconnection/nextresult.xml
Jakub Vrana ed710737ea Use entities for NULL, TRUE, FALSE
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321919 c90b9560-bf6c-de11-be94-00142212c4b1
2012-01-08 09:21:12 +00:00

129 lines
3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="mysqlnduhconnection.nextresult" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MysqlndUhConnection::nextResult</refname>
<refpurpose>Prepare next result from multi_query</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>MysqlndUhConnection::nextResult</methodname>
<methodparam><type>mysqlnd_connection</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
Prepare next result from multi_query.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
Mysqlnd connection handle. Do not modify!
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; on success.
Otherwise, returns &false;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>MysqlndUhConnection::nextResult</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
class proxy extends MysqlndUhConnection {
public function nextResult($res) {
printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
$ret = parent::nextResult($res);
printf("%s returns %s\n", __METHOD__, var_export($ret, true));
return $ret;
}
}
mysqlnd_uh_set_connection_proxy(new proxy());
$mysqli = new mysqli("localhost", "root", "", "test");
$mysqli->multi_query("SELECT 1 AS _one; SELECT 2 AS _two");
do {
$res = $mysqli->store_result();
var_dump($res->fetch_assoc());
printf("%s\n", str_repeat("-", 40));
} while ($mysqli->more_results() && $mysqli->next_result());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(1) {
["_one"]=>
string(1) "1"
}
----------------------------------------
proxy::nextResult(array (
0 => NULL,
))
proxy::nextResult returns true
array(1) {
["_two"]=>
string(1) "2"
}
----------------------------------------
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member>
<function>mysqlnd_uh_set_connection_proxy</function>
</member>
<member>
<function>mysqli_next_result</function>
</member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->