1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-25 23:52:16 +01:00
Files
archived-doc-ja/reference/sqlite/functions/sqlite-array-query.xml
2003-06-30 14:00:42 +00:00

67 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.sqlite-array-query">
<refnamediv>
<refname>sqlite_array_query</refname>
<refpurpose>指定したデータベースに対してクエリを実行し、配列を返す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>sqlite_array_query</methodname>
<methodparam><type>resource</type><parameter>db</parameter></methodparam>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
</methodsynopsis>
<para>
<function>sqlite_array_query</function> は、結果セットの各行に関し
<function>sqlite_query</function>に続いて
<function>sqlite_fetch_array</function>をコールすることに似ており、
以下の例に示すように各行を配列に保存します。
<function>sqlite_array_query</function> をコールする方が、スクリプ
トの中で行うよりも著しく高速です。
</para>
<example>
<title><function>sqlite_array_query</function>を自分で実装したもの</title>
<programlisting role="php">
<![CDATA[<?php
$q = sqlite_query($database, "SELECT * from foo LIMIT 100");
$rows = array();
while ($r = sqlite_fetch_array($q)) {
$rows[] = $r;
}
?>]]>
</programlisting>
</example>
<tip>
<para>
<function>sqlite_array_query</function> は、返すレコードが45件以下
のクエリーで最も有効です。これ以上のデータがある場合には、
より性能を最適化するために、代わりに
<function>sqlite_unbuffered_query</function>を使用するようなスクリ
プトを書くことをお薦めします。
</para>
</tip>
</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
-->