php-doc-en/reference/mongo/functions/mongo-has-next.xml
Philip Olson 8d9f8f7bc8 Fixed build (missing markup)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@276457 c90b9560-bf6c-de11-be94-00142212c4b1
2009-02-25 22:57:03 +00:00

108 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<refentry xml:id="function.mongo-has-next" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_has_next</refname>
<refpurpose>Checks if a cursor has any more documents to return</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mongo_has_next</methodname>
<methodparam><type>resource</type><parameter>cursor</parameter></methodparam>
</methodsynopsis>
<para>
Checks if a cursor has any more documents to return.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>cursor</parameter></term>
<listitem>
<para>
The database cursor to check.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If there is another document to return.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_has_next</function> example</title>
<para>
This example shows how mongo_has_next can be used to
iterate through results.
</para>
<programlisting role="php">
<![CDATA[
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
$cursor = mongo_query($conn, "foo.bar", array(), 0, 0, null, null, null);
while (mongo_has_next($cursor)) {
mongo_next($cursor);
echo "."
}
?>
]]>
</programlisting>
<para>
The above example will output a dot for each document in the collection foo.bar.
</para>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_query</function></member>
<member><function>mongo_next</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:"../../../../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
-->