php-doc-en/reference/sqlite/functions/sqlite-fetch-all.xml
Jakub Vrana 0d604bbc9d Remove <classsynopsis> from methods and fields definitions
PhD uses this context for decisions about links and similar.
It also simplifies the XML

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@322205 c90b9560-bf6c-de11-be94-00142212c4b1
2012-01-13 14:20:43 +00:00

148 lines
4.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.sqlite-fetch-all" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>sqlite_fetch_all</refname>
<refname>SQLiteResult::fetchAll</refname>
<refname>SQLiteUnbuffered::fetchAll</refname>
<refpurpose>Fetches all rows from a result set as an array of arrays</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>sqlite_fetch_all</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter><initializer>SQLITE_BOTH</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter><initializer>true</initializer></methodparam>
</methodsynopsis>
<para>&style.oop; (method):</para>
<methodsynopsis>
<type>array</type><methodname>SQLiteResult::fetchAll</methodname>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter><initializer>SQLITE_BOTH</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter><initializer>true</initializer></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>array</type><methodname>SQLiteUnbuffered::fetchAll</methodname>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter><initializer>SQLITE_BOTH</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter><initializer>true</initializer></methodparam>
</methodsynopsis>
<para>
<function>sqlite_fetch_all</function> returns an array of the entire result
set from the <parameter>result</parameter> resource. It is similar to calling
<function>sqlite_query</function> (or
<function>sqlite_unbuffered_query</function>) and then
<function>sqlite_fetch_array</function> for each row in the result set.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>result</parameter></term>
<listitem>
<para>
The SQLite result resource. This parameter is not required when using
the object-oriented method.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>result_type</parameter></term>
<listitem>
&sqlite.result-type;
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>decode_binary</parameter></term>
<listitem>
&sqlite.decode-bin;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of the remaining rows in a result set. If called right
after <function>sqlite_query</function>, it returns all rows. If called
after <function>sqlite_fetch_array</function>, it returns the rest. If
there are no rows in a result set, it returns an empty array.
</para>
&sqlite.case-fold;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Procedural example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = sqlite_open('sqlitedb');
$query = sqlite_query($dbhandle, 'SELECT name, email FROM users LIMIT 25');
$result = sqlite_fetch_all($query, SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email'];
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Object-oriented example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = new SQLiteDatabase('sqlitedb');
$query = $dbhandle->query('SELECT name, email FROM users LIMIT 25'); // buffered result set
$query = $dbhandle->unbufferedQuery('SELECT name, email FROM users LIMIT 25'); // unbuffered result set
$result = $query->fetchAll(SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email'];
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_fetch_array</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
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
-->