mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Add SQLite classes, update examples
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@177066 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0255bfb00b
commit
80c2907dc3
31 changed files with 718 additions and 127 deletions
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry id="function.sqlite-array-query">
|
||||
<refnamediv>
|
||||
<refname>sqlite_array_query</refname>
|
||||
<refname>SQLiteDatabase->arrayQuery</refname>
|
||||
<refpurpose>Execute a query against a given database and returns an array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -21,6 +22,16 @@
|
|||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>arrayQuery</methodname>
|
||||
<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>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_array_query</function> is similar to calling
|
||||
<function>sqlite_query</function> and then
|
||||
|
@ -29,9 +40,13 @@
|
|||
<function>sqlite_array_query</function> is significantly faster than
|
||||
using such a script.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>sqlite_array_query</function> implemented yourself</title>
|
||||
<programlisting role="php">
|
||||
&sqlite.result-type;
|
||||
&sqlite.case-fold;
|
||||
&sqlite.decode-bin;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>sqlite_array_query</function> implemented yourself</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$q = sqlite_query($dbhandle, "SELECT * from foo LIMIT 100");
|
||||
|
@ -41,8 +56,9 @@ while ($r = sqlite_fetch_array($q)) {
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
<function>sqlite_array_query</function> is best suited to queries
|
||||
|
@ -52,6 +68,7 @@ while ($r = sqlite_fetch_array($q)) {
|
|||
performance.
|
||||
</para>
|
||||
</tip>
|
||||
&sqlite.param-compat;
|
||||
<para>
|
||||
See also <function>sqlite_query</function>,
|
||||
<function>sqlite_fetch_array</function>, and
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.sqlite-busy-timeout">
|
||||
<refnamediv><refname>sqlite_busy_timeout</refname>
|
||||
<refnamediv>
|
||||
<refname>sqlite_busy_timeout</refname>
|
||||
<refname>SQLiteDatabase->busyTimeout</refname>
|
||||
<refpurpose>Set busy timeout duration, or disable busy handlers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,6 +13,14 @@
|
|||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>milliseconds</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>busyTimeout</methodname>
|
||||
<methodparam><type>int</type><parameter>milliseconds</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Set the maximum time that sqlite will wait for a
|
||||
<parameter>dbhandle</parameter>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.sqlite-changes">
|
||||
<refnamediv>
|
||||
<refname>sqlite_changes</refname>
|
||||
<refname>SQLiteDatabase->changes</refname>
|
||||
<refpurpose>
|
||||
Returns the number of rows that were changed by the most
|
||||
recent SQL statement
|
||||
|
@ -14,6 +15,14 @@
|
|||
<type>int</type><methodname>sqlite_changes</methodname>
|
||||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>changes</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Returns the numbers of rows that were changed by the most recent SQL
|
||||
statement executed against the <parameter>dbhandle</parameter> database
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.sqlite-column">
|
||||
<refnamediv>
|
||||
<refname>sqlite_column</refname>
|
||||
<refname>SQLiteResult->column</refname>
|
||||
<refname>SQLiteUnbuffered->column</refname>
|
||||
<refpurpose>Fetches a column from the current row of a result set</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -13,14 +15,29 @@
|
|||
<methodparam><type>mixed</type><parameter>index_or_name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>column</methodname>
|
||||
<methodparam><type>mixed</type><parameter>index_or_name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>column</methodname>
|
||||
<methodparam><type>mixed</type><parameter>index_or_name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Fetches the value of a column named <parameter>index_or_name</parameter>
|
||||
(if it is a string), or of the ordinal column numbered
|
||||
<parameter>index_or_name</parameter> (if it is an integer) from the
|
||||
current row of the query result handle <parameter>result</parameter>.
|
||||
The decode binary flag operates in the same way as described under
|
||||
<function>sqlite_fetch_array</function>.
|
||||
</para>
|
||||
&sqlite.decode-bin;
|
||||
<para>
|
||||
Use this function when you are iterating a large result set with many
|
||||
columns, or with columns that contain large amounts of data.
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<refentry id="function.sqlite-create-aggregate">
|
||||
<refnamediv>
|
||||
<refname>sqlite_create_aggregate</refname>
|
||||
<refname>SQLiteDatabase->createAggregate</refname>
|
||||
<refpurpose>Register an aggregating UDF for use in SQL statements</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -15,6 +16,17 @@
|
|||
<methodparam><type>callback</type><parameter>finalize_func</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>num_args</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>createAggregate</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>step_func</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>finalize_func</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>num_args</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_create_aggregate</function> is similar to
|
||||
<function>sqlite_create_function</function> except that it registers
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<refentry id="function.sqlite-create-function">
|
||||
<refnamediv>
|
||||
<refname>sqlite_create_function</refname>
|
||||
<refname>SQLiteDatabase->createFunction</refname>
|
||||
<refpurpose>
|
||||
Registers a "regular" User Defined Function for use in SQL statements
|
||||
</refpurpose>
|
||||
|
@ -16,6 +17,16 @@
|
|||
<methodparam><type>callback</type><parameter>callback</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>num_args</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>createFunction</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
<methodparam><type>callback</type><parameter>callback</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>num_args</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_create_function</function> allows you to register a PHP
|
||||
function with SQLite as an <acronym>UDF</acronym> (User Defined
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.sqlite-current">
|
||||
<refnamediv>
|
||||
<refname>sqlite_current</refname>
|
||||
<refname>SQLiteResult->current</refname>
|
||||
<refname>SQLiteUnbuffered->current</refname>
|
||||
<refpurpose>Fetches the current row from a result set as an array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -13,6 +15,23 @@
|
|||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>current</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>current</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_current</function> is identical to
|
||||
<function>sqlite_fetch_array</function> except that it does not advance
|
||||
|
@ -23,9 +42,9 @@
|
|||
If the current position is beyond the final row, this function returns
|
||||
&false;
|
||||
</para>
|
||||
|
||||
&sqlite.no-unbuffered;
|
||||
|
||||
&sqlite.result-type;
|
||||
&sqlite.case-fold;
|
||||
&sqlite.decode-bin;
|
||||
<para>
|
||||
See also <function>sqlite_seek</function>,
|
||||
<function>sqlite_next</function>, and
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.sqlite-exec">
|
||||
<refnamediv>
|
||||
<refname>sqlite_exec</refname>
|
||||
<refpurpose>
|
||||
Executes a result-less query against a given database
|
||||
</refpurpose>
|
||||
<refname>SQLiteDatabase->exec</refname>
|
||||
<refpurpose>Executes a result-less query against a given database</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
@ -19,6 +18,14 @@
|
|||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>exec</methodname>
|
||||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Executes an SQL statement given by the <parameter>query</parameter> against
|
||||
a given database handle (specified by the <parameter>dbhandle</parameter>
|
||||
|
@ -28,15 +35,6 @@
|
|||
This function will return a boolean result; &true; for success or &false; for failure.
|
||||
If you need to run a query that returns rows, see <function>sqlite_query</function>.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
Two alternative syntaxes are supported for compatibility with other
|
||||
database extensions (such as MySQL).
|
||||
The preferred form is the first one, where the
|
||||
<parameter>db</parameter> parameter is the first parameter to the
|
||||
function.
|
||||
</simpara>
|
||||
</note>
|
||||
<warning>
|
||||
<simpara>
|
||||
SQLite <emphasis>will</emphasis> execute multiple queries separated by
|
||||
|
@ -44,8 +42,10 @@
|
|||
loaded from a file or have embedded in a script.
|
||||
</simpara>
|
||||
</warning>
|
||||
&sqlite.param-compat;
|
||||
<para>
|
||||
See also <function>sqlite_query</function>, <function>sqlite_unbuffered_query</function> and
|
||||
See also <function>sqlite_query</function>,
|
||||
<function>sqlite_unbuffered_query</function> and
|
||||
<function>sqlite_array_query</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,23 +1,30 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.sqlite-factory">
|
||||
<refnamediv>
|
||||
<refname>sqlite_factory</refname>
|
||||
<refpurpose>
|
||||
Opens a SQLite database and creates an object for it
|
||||
</refpurpose>
|
||||
<refpurpose>Opens a SQLite database and returns an SQLiteDatabase object</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>SQLite</type><methodname>sqlite_factory</methodname>
|
||||
<type>SQLiteDatabase</type><methodname>sqlite_factory</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
<para>
|
||||
<function>sqlite_factory</function> behaves similarly to
|
||||
<function>sqlite_open</function> in that it opens an SQLite database or
|
||||
attempts to create it if it does not exist. However, a
|
||||
<link linkend="sqlite.class.sqlitedatabase">SQLiteDatabase</link> object is
|
||||
returned rather than a procedural resource. Please see the
|
||||
<function>sqlite_open</function> reference page for usage and caveats.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>sqlite_open</function> and
|
||||
<function>sqlite_popen</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.sqlite-fetch-all">
|
||||
<refnamediv>
|
||||
<refname>sqlite_fetch_all</refname>
|
||||
<refpurpose>
|
||||
Fetches all rows from a result set as an array of arrays
|
||||
</refpurpose>
|
||||
<refname>SQLiteResult->fetchAll</refname>
|
||||
<refname>SQLiteUnbuffered->fetchAll</refname>
|
||||
<refpurpose>Fetches all rows from a result set as an array of arrays</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
@ -15,6 +15,23 @@
|
|||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>fetchAll</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>fetchAll</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.sqlite-fetch-array">
|
||||
<refnamediv>
|
||||
<refname>sqlite_fetch_array</refname>
|
||||
<refname>SQLiteResult->fetch</refname>
|
||||
<refname>SQLiteUnbuffered->fetch</refname>
|
||||
<refpurpose>Fetches the next row from a result set as an array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -13,34 +15,31 @@
|
|||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>fetch</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>fetch</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Fetches the next row from the given <parameter>result</parameter> handle.
|
||||
If there are no more rows, returns &false;, otherwise returns an
|
||||
associative array representing the row data.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>result_type</parameter> can be used to specify how you want
|
||||
the results to be returned. The default value is
|
||||
<literal>SQLITE_BOTH</literal> which returns columns indexed by their
|
||||
ordinal column number and by column name.
|
||||
<literal>SQLITE_ASSOC</literal> causes the array to be indexed only by
|
||||
column names, and <literal>SQLITE_NUM</literal> to be indexed only by
|
||||
ordinal column numbers.
|
||||
</para>
|
||||
<para>
|
||||
The column names returned by <literal>SQLITE_ASSOC</literal> and
|
||||
<literal>SQLITE_BOTH</literal> will be case-folded according to the value
|
||||
of the <link linkend="ini.sqlite.assoc-case">sqlite.assoc_case</link>
|
||||
configuration option.
|
||||
</para>
|
||||
<para>
|
||||
When <parameter>decode_binary</parameter> is set to &true; (the default),
|
||||
PHP will decode the binary encoding it applied to the data if it
|
||||
was encoded using the <function>sqlite_escape_string</function>. You
|
||||
will usually always leave this value at its default, unless you are
|
||||
interoperating with databases created by other sqlite capable
|
||||
applications.
|
||||
</para>
|
||||
&sqlite.result-type;
|
||||
&sqlite.case-fold;
|
||||
&sqlite.decode-bin;
|
||||
<para>
|
||||
See also <function>sqlite_array_query</function> and
|
||||
<function>sqlite_fetch_string</function>.
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry id="function.sqlite-fetch-column-types">
|
||||
<refnamediv>
|
||||
<refname>sqlite_fetch_column_types</refname>
|
||||
<refname>SQLiteDatabase->fetchColumnTypes</refname>
|
||||
<refpurpose>
|
||||
Return an array of column types from a particular table
|
||||
</refpurpose>
|
||||
|
@ -10,14 +11,64 @@
|
|||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>sqlite_fetch_column_types</methodname>
|
||||
<type>array</type><methodname>sqlite_fetch_column_types</methodname>
|
||||
<methodparam><type>string</type><parameter>table_name</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>db</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>fetchColumnTypes</methodname>
|
||||
<methodparam><type>string</type><parameter>table_name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_fetch_column_types</function> returns an array of column
|
||||
data types from the specified <parameter>table_name</parameter> table.
|
||||
</para>
|
||||
<para>
|
||||
The optional <parameter>result_type</parameter> parameter accepts a
|
||||
constant and determines how the returned array will be indexed. Using
|
||||
<constant>SQLITE_ASSOC</constant> will return only associative indices
|
||||
(named fields) while <constant>SQLITE_NUM</constant> will return only
|
||||
numerical indices (ordinal field numbers). <constant>SQLITE_BOTH</constant>
|
||||
will return both associative and numerical indices.
|
||||
<constant>SQLITE_ASSOC</constant> is the default for this function.
|
||||
</para>
|
||||
&sqlite.case-fold;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>sqlite_fetch_column_types</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$db = sqlite_open('mysqlitedb');
|
||||
sqlite_query($db, 'CREATE TABLE foo (bar varchar(10), arf text)');
|
||||
$cols = sqlite_fetch_column_types('foo', $db, SQLITE_ASSOC);
|
||||
|
||||
&warn.undocumented.func;
|
||||
foreach ($cols as $column => $type) {
|
||||
echo "Column: $column Type: $type";
|
||||
}
|
||||
/* Output:
|
||||
* Column: bar Type: VARCHAR
|
||||
* Column: arf Type: TEXT
|
||||
*/
|
||||
|
||||
/* OO Example */
|
||||
$db =& new SQLiteDatabase('mysqlitedb');
|
||||
$db->query('CREATE TABLE foo (bar varchar(10), arf text)');
|
||||
$cols = $db->fetchColumnTypes('foo', SQLITE_ASSOC);
|
||||
|
||||
foreach ($cols as $column => $type) {
|
||||
echo "Column: $column Type: $type";
|
||||
}
|
||||
?]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.sqlite-fetch-object">
|
||||
<refnamediv>
|
||||
<refname>sqlite_fetch_object</refname>
|
||||
<refpurpose>
|
||||
Fetches the next row from a result set as an object
|
||||
</refpurpose>
|
||||
<refname>SQLiteResult->fetchObject</refname>
|
||||
<refname>SQLiteUnbuffered->fetchObject</refname>
|
||||
<refpurpose>Fetches the next row from a result set as an object</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
@ -16,7 +16,26 @@
|
|||
<methodparam choice="opt"><type>array</type><parameter>ctor_params</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>fetchObject</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>ctor_params</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>object</type><methodname>fetchObject</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>ctor_params</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.sqlite-fetch-single">
|
||||
<refnamediv>
|
||||
<refname>sqlite_fetch_single</refname>
|
||||
<refname>SQLiteResult->fetchSingle</refname>
|
||||
<refname>SQLiteUnbuffered->fetchSingle</refname>
|
||||
<refpurpose>Fetches the first column of a result set as a string</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -12,6 +14,21 @@
|
|||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fetchSingle</methodname>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fetchSingle</methodname>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_fetch_single</function> is identical to
|
||||
<function>sqlite_fetch_array</function> except that it returns the value
|
||||
|
@ -21,6 +38,7 @@
|
|||
This is the most optimal way to retrieve data when you are only
|
||||
interested in the values from a single column of data.
|
||||
</para>
|
||||
&sqlite.decode-bin;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>sqlite_fetch_single</function> example</title>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.sqlite-field-name">
|
||||
<refnamediv>
|
||||
<refname>sqlite_field_name</refname>
|
||||
<refname>SQLiteResult->fieldName</refname>
|
||||
<refname>SQLiteUnbuffered->fieldName</refname>
|
||||
<refpurpose>Returns the name of a particular field</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -12,10 +14,31 @@
|
|||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>field_index</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fieldName</methodname>
|
||||
<methodparam><type>int</type><parameter>field_index</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fieldName</methodname>
|
||||
<methodparam><type>int</type><parameter>field_index</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Given the ordinal column number, <literal>field_index</literal>, returns
|
||||
the name of that field in the result handle
|
||||
<parameter>result</parameter>.
|
||||
Given the ordinal column number, <parameter>field_index</parameter>,
|
||||
<function>sqlite_field_name</function> returns the name of that field in
|
||||
the result set <parameter>result</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
The column name returned by <function>sqlite_field_name</function> will be
|
||||
case-folded according to the value of the
|
||||
<link linkend="ini.sqlite.assoc-case">sqlite.assoc_case</link> configuration
|
||||
option.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.sqlite-has-prev">
|
||||
<refnamediv>
|
||||
<refname>sqlite_has_prev</refname>
|
||||
<refname>SQLiteResult->hasPrev</refname>
|
||||
<refpurpose>Returns whether or not a previous row is available</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,14 +12,20 @@
|
|||
<type>bool</type><methodname>sqlite_has_prev</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>hasPrev</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_has_prev</function> returns &true; if there are more
|
||||
previous rows available from the <parameter>result</parameter> handle, or
|
||||
&false; otherwise;
|
||||
</para>
|
||||
|
||||
&sqlite.no-unbuffered;
|
||||
|
||||
<para>
|
||||
See also
|
||||
<function>sqlite_prev</function>,
|
||||
|
|
61
reference/sqlite/functions/sqlite-key.xml
Executable file
61
reference/sqlite/functions/sqlite-key.xml
Executable file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.sqlite-key">
|
||||
<refnamediv>
|
||||
<refname>sqlite_key</refname>
|
||||
<refname>SQLiteResult->key</refname>
|
||||
<refpurpose>Returns the current row index</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>sqlite_key</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>key</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_key</function> returns the current row index of the
|
||||
buffered result set <parameter>result</parameter>.
|
||||
</para>
|
||||
&sqlite.no-unbuffered;
|
||||
<note>
|
||||
<simpara>
|
||||
Prior to PHP 5.0.4, <function>sqlite_key</function> was only able to be
|
||||
called as a method on a
|
||||
<link linkend="sqlite.class.sqliteresult">SQLiteResult</link> object and
|
||||
not procedurally.
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>sqlite_next</function>,
|
||||
<function>sqlite_current</function> and
|
||||
<function>sqlite_rewind</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
|
||||
-->
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.sqlite-last-error">
|
||||
<refnamediv>
|
||||
<refname>sqlite_last_error</refname>
|
||||
<refname>SQLiteDatabase->lastError</refname>
|
||||
<refpurpose>Returns the error code of the last error for a database</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,6 +12,14 @@
|
|||
<type>int</type><methodname>sqlite_last_error</methodname>
|
||||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>lastError</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Returns the error code from the last operation performed on
|
||||
<parameter>dbhandle</parameter>, the database handle. A human readable
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.sqlite-last-insert-rowid">
|
||||
<refnamediv>
|
||||
<refname>sqlite_last_insert_rowid</refname>
|
||||
<refname>SQLiteDatabase->lastInsertRowid</refname>
|
||||
<refpurpose>Returns the rowid of the most recently inserted row</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,6 +12,14 @@
|
|||
<type>int</type><methodname>sqlite_last_insert_rowid</methodname>
|
||||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>lastInsertRowid</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Returns the rowid of the row that was most recently inserted into the
|
||||
database <parameter>dbhandle</parameter>, if it was created as an
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.sqlite-next">
|
||||
<refnamediv>
|
||||
<refname>sqlite_next</refname>
|
||||
<refname>SQLiteResult->next</refname>
|
||||
<refname>SQLiteUnbuffered->next</refname>
|
||||
<refpurpose>Seek to the next row number</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,14 +13,26 @@
|
|||
<type>bool</type><methodname>sqlite_next</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>next</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>next</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_next</function> advances the result handle
|
||||
<parameter>result</parameter> to the next row.
|
||||
Returns &false; if there are no more rows, &true; otherwise.
|
||||
</para>
|
||||
|
||||
&sqlite.no-unbuffered;
|
||||
|
||||
<para>
|
||||
See also <function>sqlite_seek</function>,
|
||||
<function>sqlite_current</function> and
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.sqlite-num-fields">
|
||||
<refnamediv>
|
||||
<refname>sqlite_num_fields</refname>
|
||||
<refname>SQLiteResult->numFields</refname>
|
||||
<refname>SQLiteUnbuffered->numFields</refname>
|
||||
<refpurpose>Returns the number of fields in a result set</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,6 +13,21 @@
|
|||
<type>int</type><methodname>sqlite_num_fields</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>numFields</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>numFields</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Returns the number of fields in the <parameter>result</parameter> set.
|
||||
</para>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<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>
|
||||
|
@ -11,13 +12,19 @@
|
|||
<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.
|
||||
set.
|
||||
</para>
|
||||
|
||||
&sqlite.no-unbuffered;
|
||||
|
||||
<para>
|
||||
See also <function>sqlite_changes</function> and
|
||||
<function>sqlite_query</function>.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<refentry id="function.sqlite-open">
|
||||
<refnamediv>
|
||||
<refname>sqlite_open</refname>
|
||||
|
@ -13,6 +13,16 @@
|
|||
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (constructor):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<methodname>__construct</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Returns a resource (database handle) on success, &false; on error.
|
||||
</para>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.sqlite-prev">
|
||||
<refnamediv>
|
||||
<refname>sqlite_prev</refname>
|
||||
<refname>SQLiteResult->prev</refname>
|
||||
<refpurpose>Seek to the previous row number of a result set</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,14 +12,20 @@
|
|||
<type>bool</type><methodname>sqlite_prev</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>prev</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_prev</function> seeks back the
|
||||
<parameter>result</parameter> handle to the previous row. Returns &false;
|
||||
if there are no more rows, &true; otherwise.
|
||||
</para>
|
||||
|
||||
&sqlite.no-unbuffered;
|
||||
|
||||
<para>
|
||||
See also
|
||||
<function>sqlite_has_prev</function>,
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<refentry id="function.sqlite-query">
|
||||
<refnamediv>
|
||||
<refname>sqlite_query</refname>
|
||||
<refpurpose>
|
||||
Executes a query against a given database and returns a result handle
|
||||
</refpurpose>
|
||||
<refname>SQLiteDatabase->query</refname>
|
||||
<refpurpose>Executes a query against a given database and returns a result handle</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
@ -19,6 +18,14 @@
|
|||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>SQLiteResult</type><methodname>query</methodname>
|
||||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Executes an SQL statement given by the <parameter>query</parameter> against
|
||||
a given database handle (specified by the <parameter>dbhandle</parameter>
|
||||
|
@ -43,15 +50,7 @@
|
|||
recommended that you use the much higher performance
|
||||
<function>sqlite_unbuffered_query</function> instead.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
Two alternative syntaxes are supported for compatibility with other
|
||||
database extensions (such as MySQL).
|
||||
The preferred form is the first one, where the
|
||||
<parameter>dbhandle</parameter> parameter is the first parameter to the
|
||||
function.
|
||||
</simpara>
|
||||
</note>
|
||||
&sqlite.param-compat;
|
||||
<warning>
|
||||
<simpara>
|
||||
SQLite <emphasis>will</emphasis> execute multiple queries separated by
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.sqlite-rewind">
|
||||
<refnamediv>
|
||||
<refname>sqlite_rewind</refname>
|
||||
<refname>SQLiteResult->rewind</refname>
|
||||
<refpurpose>Seek to the first row number</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,14 +12,20 @@
|
|||
<type>bool</type><methodname>sqlite_rewind</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>rewind</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_rewind</function> seeks back to the first row in the
|
||||
result set. Returns &false; if there are no rows in the result set,
|
||||
&true; otherwise.
|
||||
</para>
|
||||
|
||||
&sqlite.no-unbuffered;
|
||||
|
||||
<para>
|
||||
See also <function>sqlite_next</function>,
|
||||
<function>sqlite_current</function>, and
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry id="function.sqlite-seek">
|
||||
<refnamediv>
|
||||
<refname>sqlite_seek</refname>
|
||||
<refname>SQLiteResult->seek</refname>
|
||||
<refpurpose>Seek to a particular row number of a buffered result set</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -12,14 +13,20 @@
|
|||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>rownum</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>seek</methodname>
|
||||
<methodparam><type>int</type><parameter>rownum</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_seek</function> seeks to the row given by the parameter
|
||||
<parameter>rownum</parameter>. The row number is zero-based (0 is the
|
||||
first row). Returns &false; if the row does not exist, &true; otherwise.
|
||||
</para>
|
||||
|
||||
&sqlite.no-unbuffered;
|
||||
|
||||
<para>
|
||||
See also <function>sqlite_next</function>,
|
||||
<function>sqlite_current</function> and
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.sqlite-single-query">
|
||||
<refnamediv>
|
||||
<refname>sqlite_single_query</refname>
|
||||
<refname>SQLiteDatabase->singleQuery</refname>
|
||||
<refpurpose>
|
||||
Executes a query and returns either an array for one single column or the value of the first row
|
||||
</refpurpose>
|
||||
|
@ -16,6 +17,16 @@
|
|||
<methodparam choice="opt"><type>bool</type><parameter>first_row_only</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>singleQuery</methodname>
|
||||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>first_row_only</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.sqlite-unbuffered-query">
|
||||
<refnamediv>
|
||||
<refname>sqlite_unbuffered_query</refname>
|
||||
<refname>SQLiteDatabase->unbufferedQuery</refname>
|
||||
<refpurpose>Execute a query that does not prefetch and buffer all data</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -17,6 +18,14 @@
|
|||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>SQLiteUnbuffered</type><methodname>unbufferedQuery</methodname>
|
||||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_unbuffered_query</function> is identical to
|
||||
<function>sqlite_query</function> except that the result that is returned
|
||||
|
@ -37,6 +46,7 @@
|
|||
returned from <function>sqlite_unbuffered_query</function>.
|
||||
</para>
|
||||
</note>
|
||||
&sqlite.param-compat;
|
||||
<para>
|
||||
See also <function>sqlite_query</function>.
|
||||
</para>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.sqlite-valid">
|
||||
<refnamediv>
|
||||
<refname>sqlite_valid</refname>
|
||||
<refname>SQLiteResult->valid</refname>
|
||||
<refname>SQLiteUnbuffered->valid</refname>
|
||||
<refpurpose>Returns whether more rows are available</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -11,9 +13,30 @@
|
|||
<type>bool</type><methodname>sqlite_valid</methodname>
|
||||
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
<para>Object oriented style (method):</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteResult</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>valid</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SQLiteUnbuffered</classname></ooclass>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>valid</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
<function>sqlite_valid</function> returns &true; if there are more
|
||||
rows available from the <parameter>result</parameter> handle, or &false;
|
||||
otherwise.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>sqlite_num_rows</function> and
|
||||
<function>sqlite_changes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<reference id="ref.sqlite">
|
||||
<title>SQLite</title>
|
||||
<titleabbrev>SQLite</titleabbrev>
|
||||
|
@ -61,6 +61,170 @@
|
|||
</section>
|
||||
|
||||
&reference.sqlite.constants;
|
||||
|
||||
<section id="sqlite.classes">
|
||||
&reftitle.classes;
|
||||
|
||||
<section id="sqlite.class.sqlitedatabase">
|
||||
<title><classname>SQLiteDatabase</classname></title>
|
||||
<para>
|
||||
Represents an opened SQLite database.
|
||||
</para>
|
||||
<section id='sqlite.class.sqlitedatabase.constructor'>
|
||||
&reftitle.constructor;
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-open'>__construct</link> - construct a new SQLiteDatabase object</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id='sqlite.class.sqlitedatabase.methods'>
|
||||
&reftitle.methods;
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-query'>query</link> - Execute a query</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-exec'>queryExec</link> - Execute a result-less query</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-array-query'>arrayQuery</link> - Execute a query and return the result as an array</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-single-query'>singleQuery</link> - Execute a query and return either an array for one single column or the value of the first row</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-unbuffered-query'>unbufferedQuery</link> - Execute an unbuffered query</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-last-insert-rowid'>lastInsertRowid</link> - Returns the rowid of the most recently inserted row</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-changes'>changes</link> - Returns the number of rows changed by the most recent statement</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-create-aggregate'>createAggregate</link> - Register an aggregating UDF for use in SQL statements</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-create-function'>createFunction</link> - Register a UDF for use in SQL statements</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-busy-timeout'>busyTimeout</link> - Sets or disables busy timeout duration</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-last-error'>lastErorr</link> - Returns the last error code of the most recently encountered error</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-column-types'>fetchColumnTypes</link> - Return an array of column types from a particular table</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="sqlite.class.sqliteresult">
|
||||
<title><classname>SQLiteResult</classname></title>
|
||||
<para>
|
||||
Represents a buffered SQLite result set.
|
||||
</para>
|
||||
<section id='sqlite.class.sqliteresult.methods'>
|
||||
&reftitle.methods;
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-array'>fetch</link> - Fetches the next row from the result set as an array</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-object'>fetchObject</link> - Fetches the next row from the result set as an object</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-single'>fetchSingle</link> - Fetches the first column from the result set as a string</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-all'>fetchAll</link> - Fetches all rows from the result set as an array of arrays</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-column'>column</link> - Fetches a column from the current row of the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-num-fields'>numFields</link> - Returns the number of fields in the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-field-name'>fieldName</link> - Returns the name of a particular field in the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-current'>current</link> - Fetches the current row from the result set as an array</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-key'>key</link> - Return the current row index</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-next'>next</link> - Seek to the next row number</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-valid'>valid</link> - Returns whether more rows are available</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-rewind'>rewind</link> - Seek to the first row number of the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-prev'>prev</link> - Seek to the previous row number of the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-has-prev'>hasPrev</link> - Returns whether or not a previous row is available</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-num-rows'>numRows</link> - Returns the number of rows in the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-seek'>seek</link> - Seek to a particular row number</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="sqlite.class.sqliteunbuffered">
|
||||
<title><classname>SQLiteUnbuffered</classname></title>
|
||||
<para>
|
||||
Represents an unbuffered SQLite result set. Unbuffered results sets are sequential, foward-seeking only.
|
||||
</para>
|
||||
<section id='sqlite.class.sqliteunbuffered.methods'>
|
||||
&reftitle.methods;
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-array'>fetch</link> - Fetches the next row from the result set as an array</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-object'>fetchObject</link> - Fetches the next row from the result set as an object</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-single'>fetchSingle</link> - Fetches the first column from the result set as a string</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-fetch-all'>fetchAll</link> - Fetches all rows from the result set as an array of arrays</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-column'>column</link> - Fetches a column from the current row of the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-num-fields'>numFields</link> - Returns the number of fields in the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-field-name'>fieldName</link> - Returns the name of a particular field in the result set</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-current'>current</link> - Fetches the current row from the result set as an array</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-next'>next</link> - Seek to the next row number</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><link linkend='function.sqlite-valid'>valid</link> - Returns whether more rows are available</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
&reference.sqlite.ini;
|
||||
</partintro>
|
||||
|
||||
|
|
Loading…
Reference in a new issue