mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 16:32:13 +01:00
- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there - Bump EN-Revision where appropriate git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@238324 c90b9560-bf6c-de11-be94-00142212c4b1
169 lines
5.5 KiB
XML
169 lines
5.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 1.12 Maintainer: javi Status: ready -->
|
|
<refentry xml:id="function.sqlite-array-query" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>sqlite_array_query</refname>
|
|
<refname>SQLiteDatabase->arrayQuery</refname>
|
|
<refpurpose>Ejecuta una consulta contra una base de datos y devuelve el resultado en forma de matriz</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>sqlite_array_query</methodname>
|
|
<methodparam><type>resource</type><parameter>manejador_bd</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>consulta</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>tipo_resultado</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>decodificar_binario</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>sqlite_array_query</methodname>
|
|
<methodparam><type>string</type><parameter>consulta</parameter></methodparam>
|
|
<methodparam><type>resource</type><parameter>manejador_bd</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>tipo_resultado</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>decodificar_binario</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>Método que sigue el estilo orientado a objetos:</para>
|
|
<classsynopsis>
|
|
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>arrayQuery</methodname>
|
|
<methodparam><type>string</type><parameter>consulta</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>tipo_resultado</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>decodificar_binario</parameter></methodparam>
|
|
</methodsynopsis>
|
|
</classsynopsis>
|
|
<para>
|
|
<function>sqlite_array_query</function> executes the given query and returns
|
|
an array of the entire result set. It is similar to calling <function>
|
|
sqlite_query</function> and then <function>sqlite_fetch_array</function>
|
|
for each row in the result set. <function>sqlite_array_query</function> is
|
|
significantly faster than the aforementioned.
|
|
</para>
|
|
<tip>
|
|
<para>
|
|
<function>sqlite_array_query</function> está especialmente preparada para las
|
|
consultas que devuelven 45 filas o menos. Si el resultado es más grande
|
|
se recomienda emplear la función <function>sqlite_unbuffered_query</function>
|
|
que tiene un mejor rendimiento con resultados grandes.
|
|
</para>
|
|
</tip>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>consulta</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La consulta que se quiere ejecutar.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>manejador_bd</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El recurso que identifica la base de datos SQLite (y que es el que
|
|
devuelve la función <function>sqlite_open</function>).
|
|
Este parámetro no se requiere cuando se emplea el método orientado
|
|
a objetos.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>tipo_resultado</parameter></term>
|
|
<listitem>
|
|
&sqlite.result-type;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>decodificar_binario</parameter></term>
|
|
<listitem>
|
|
&sqlite.decode-bin;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
&sqlite.param-compat;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve una matriz que contiene todo el resultado completo o &false; en cualquier otro caso.
|
|
</para>
|
|
&sqlite.case-fold;
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo no orientado a objetos</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$manejador_bd = sqlite_open('sqlitedb');
|
|
$resultado = sqlite_array_query($manejador_bd, 'SELECT nombre, email FROM usuarios LIMIT 25', SQLITE_ASSOC);
|
|
foreach ($resultado as $fila) {
|
|
echo 'Nombre: ' . $fila['nombre'] . ' E-mail: ' . $fila['email'];
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo orientado a objetos</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$manejador_bd = new SQLiteDatabase('sqlitedb');
|
|
$resultado = $manejador_bd->arrayQuery('SELECT nombre, email FROM usuarios LIMIT 25', SQLITE_ASSOC);
|
|
foreach ($resultado as $fila) {
|
|
echo 'Nombre: ' . $fila['nombre'] . ' E-mail: ' . $fila['email'];
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>sqlite_query</function></member>
|
|
<member><function>sqlite_fetch_array</function></member>
|
|
<member><function>sqlite_fetch_string</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:"../../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
|
|
-->
|