php-doc-en/reference/sqlite/functions/sqlite-num-rows.xml
Kenneth Schwartz 9d7040bd3a fix examples
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@177690 c90b9560-bf6c-de11-be94-00142212c4b1
2005-01-19 22:13:08 +00:00

75 lines
2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<refentry id="function.sqlite-num-rows">
<refnamediv>
<refname>sqlite_num_rows</refname>
<refname>SQLiteResult->numRows</refname>
<refpurpose>Returns the number of rows in a buffered result set</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>sqlite_num_rows</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>Object oriented style (method):</para>
<classsynopsis>
<ooclass><classname>SQLiteResult</classname></ooclass>
<methodsynopsis>
<type>int</type><methodname>numRows</methodname>
<void/>
</methodsynopsis>
</classsynopsis>
<para>
Returns the number of rows in the buffered <parameter>result</parameter>
set.
</para>
&sqlite.no-unbuffered;
<para>
<example>
<title><function>sqlite_num_rows</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$db = sqlite_open('mysqlitedb');
$result = sqlite_query($db, "SELECT * FROM mytable WHERE name='John Doe'");
$rows = sqlite_num_rows($result);
echo "Number of rows: $rows";
/* OO Example */
$db = new SQLiteDatabase('mysqlitedb');
$result = $db->query("SELECT * FROM mytable WHERE name='John Doe'");
$rows = $result->numRows();
echo "Number of rows: $rows";
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>sqlite_changes</function> and
<function>sqlite_query</function>.
</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
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
-->