mirror of
https://github.com/php/doc-es.git
synced 2026-03-25 16:02:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@324616 c90b9560-bf6c-de11-be94-00142212c4b1
152 lines
4.9 KiB
XML
152 lines
4.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0d604bbc9d3b741d53e7fac26f5b24c306751e9a Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<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>Recupera todas las filas de un conjunto de resultados como un array de 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; (método):</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> devuelve un array del conjunto de resultados
|
|
completo desde el recurso <parameter>result</parameter>. Es similar a llamar a
|
|
<function>sqlite_query</function> (o a
|
|
<function>sqlite_unbuffered_query</function>) y después a
|
|
<function>sqlite_fetch_array</function> para cada fila del conjunto de resultados.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>result</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El recurso de resultados de SQLite. Este parámetro no es necesario cuando se usa
|
|
el método orientado a objetos.
|
|
</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>
|
|
Devuelve un array de las filas restantes de un conjunto de resultados. Si se llama justo
|
|
después de <function>sqlite_query</function>, devuelve todas las filas. Si se llama
|
|
después de <function>sqlite_fetch_array</function>, devuelve el resto. Si
|
|
no hay filas en el conjunto de resultados, devuelve un array vacío.
|
|
</para>
|
|
&sqlite.case-fold;
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo procedimental</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>Ejemplo orientado a objetos</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
|
|
-->
|