switch to new structure

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@180267 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kenneth Schwartz 2005-02-21 00:31:07 +00:00
parent 8af737a4e3
commit ab8f44f73b
41 changed files with 1721 additions and 396 deletions

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>sqlite_array_query</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -33,54 +34,11 @@
</methodsynopsis>
</classsynopsis>
<para>
<function>sqlite_array_query</function> is similar to calling
<function>sqlite_query</function> and then
<function>sqlite_fetch_array</function> for each row of the result set
and storing it into an array, as shown in the example below. Calling
<function>sqlite_array_query</function> is significantly faster than
using such a script.
</para>
&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 name, email FROM users LIMIT 25");
$rows = array();
while ($r = sqlite_fetch_array($q)) {
$rows[] = $r;
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title><function>sqlite_array_query</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = sqlite_open('sqlitedb');
$result = sqlite_array_query($dbhandle, 'SELECT name, email FROM users LIMIT 25', SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email'];
}
/* OO Example */
$dbhandle = new SQLiteDatabase('sqlitedb');
$result = $dbhandle->arrayQuery('SELECT name, email FROM users LIMIT 25', SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email'];
}
?>
]]>
</programlisting>
</example>
<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>
@ -91,14 +49,103 @@ foreach ($result as $entry) {
performance.
</para>
</tip>
&sqlite.param-compat;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_query</function>,
<function>sqlite_fetch_array</function>, and
<function>sqlite_fetch_string</function>.
<variablelist>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
The query to be executed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. 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>
&sqlite.param-compat;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of the entire result set; &false; otherwise.
</para>
&sqlite.case-fold;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Procedural style</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = sqlite_open('sqlitedb');
$result = sqlite_array_query($dbhandle, 'SELECT name, email FROM users LIMIT 25', SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email'];
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Object-oriented style</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = new SQLiteDatabase('sqlitedb');
$result = $dbhandle->arrayQuery('SELECT name, email FROM users LIMIT 25', 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_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

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.sqlite-busy-timeout">
<refnamediv>
<refname>sqlite_busy_timeout</refname>
<refname>SQLiteDatabase->busyTimeout</refname>
<refpurpose>Set busy timeout duration, or disable busy handlers</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>sqlite_busy_timeout</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -22,29 +23,70 @@
</methodsynopsis>
</classsynopsis>
<para>
Set the maximum time that sqlite will wait for a
<parameter>dbhandle</parameter>
to become ready for use to <parameter>milliseconds</parameter>.
If <parameter>milliseconds</parameter> is <literal>0</literal>, busy
handlers will be disabled and sqlite will return immediately with a
<literal>SQLITE_BUSY</literal> status code if another process/thread has
the database locked for an update.
Set the maximum time, in milliseconds, that SQLite will wait for a
<parameter>dbhandle</parameter> to become ready for use.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
PHP sets the default busy timeout to be 60 seconds when the database is
opened.
<variablelist>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>milliseconds</parameter></term>
<listitem>
<para>
The number of milliseconds. When set to
<literal>0</literal>, busy handlers will be disabled and SQLite will
return immediately with a <literal>SQLITE_BUSY</literal> status code
if another process/thread has the database locked for an update.
</para>
<para>
PHP sets the default busy timeout to be 60 seconds when the database is
opened.
</para>
<note>
<para>
There are one thousand (1000) milliseconds in one second.
</para>
</note>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_busy_timeout</function> example</title>
<title>Procedural style</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = sqlite_open('sqlitedb');
sqlite_busy_timeout($dbhandle, 10000); // set timeout to 10 seconds
sqlite_busy_timeout($dbhandle, 0); // disable busy handler
/* OO Example */
?>]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Object oriented style</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = new SQLiteDatabase('sqlitedb');
$dbhandle->busyTimeout(10000); // 10 seconds
$dbhandle->busyTimeout(0); // disable
@ -52,16 +94,18 @@ $dbhandle->busyTimeout(0); // disable
</programlisting>
</example>
</para>
<note>
<para>
There are one thousand (1000) milliseconds in one second.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_open</function>.
<simplelist>
<member><function>sqlite_open</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.sqlite-changes">
<refnamediv>
<refname>sqlite_changes</refname>
@ -9,8 +9,9 @@
recent SQL statement
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>sqlite_changes</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -28,9 +29,31 @@
statement executed against the <parameter>dbhandle</parameter> database
handle.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_changes</function> example</title>
<title>Procedural style</title>
<programlisting role="php">
<![CDATA[
<?php
@ -41,8 +64,16 @@ if (!$query) {
} else {
echo 'Number of rows modified: ', sqlite_changes($dbhandle);
}
/* OO Example */
?>]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Object oriented style</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = new SQLiteDatabase('mysqlitedb');
$query = $dbhandle->query("UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!$query) {
@ -50,13 +81,18 @@ if (!$query) {
} else {
echo 'Number of rows modified: ', $dbhandle->changes();
}
?>]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_num_rows</function>.
<simplelist>
<member><function>sqlite_open</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.sqlite-close">
<refnamediv>
<refname>sqlite_close</refname>
<refpurpose>Closes an open SQLite database</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>sqlite_close</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -16,6 +17,27 @@
If the database was persistent, it will be closed and removed from the
persistent list.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_close</function> example</title>
@ -29,12 +51,19 @@ sqlite_close($dbhandle);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_open</function> and
<function>sqlite_popen</function>.
<simplelist>
<member><function>sqlite_open</function></member>
<member><function>sqlite_popen</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<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>
<title>Description</title>
<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 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>sqlite_column</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -37,16 +38,59 @@
<parameter>index_or_name</parameter> (if it is an integer) from the
current row of the query result handle <parameter>result</parameter>.
</para>
&sqlite.decode-bin;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
Use this function when you are iterating a large result set with many
columns, or with columns that contain large amounts of data.
<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>index_or_name</parameter></term>
<listitem>
<para>
The column index or name to fetch.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>decode_binary</parameter></term>
<listitem>
&sqlite.decode-bin;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Use this function when you are iterating a large result set with many
columns, or with columns that contain large amounts of data.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_fetch_string</function>.
<simplelist>
<member><function>sqlite_fetch_string</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_create_aggregate</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -45,6 +46,61 @@
Callback functions should return a type understood by SQLite (i.e.
<link linkend="language.types.intro">scalar type</link>).
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>function_name</parameter></term>
<listitem>
<para>
The name of the function used in SQL statements.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>step_func</parameter></term>
<listitem>
<para>
Callback function called for each row of the result set.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>finalize_func</parameter></term>
<listitem>
<para>
Callback function to aggregate the "stepped" data from each row.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>num_args</parameter></term>
<listitem>
<para>
Hint to the SQLite parser if the callback function accepts a
predetermined number of arguments.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>max_length aggregation function example</title>
@ -134,13 +190,20 @@ var_dump(sqlite_array_query($dbhandle, 'SELECT max_len(a) from strings'));
SQL functions.
</para>
</tip>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_create_function</function>,
<function>sqlite_udf_encode_binary</function> and
<function>sqlite_udf_decode_binary</function>.
<simplelist>
<member><function>sqlite_create_function</function></member>
<member><function>sqlite_udf_encode_binary</function></member>
<member><function>sqlite_udf_decode_binary</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.sqlite-create-function">
<refnamediv>
<refname>sqlite_create_function</refname>
@ -8,8 +8,9 @@
Registers a "regular" User Defined Function for use in SQL statements
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_create_function</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -30,26 +31,66 @@
<para>
<function>sqlite_create_function</function> allows you to register a PHP
function with SQLite as an <acronym>UDF</acronym> (User Defined
Function), so that it can be called from within your SQL
statements.
</para>
<para>
<parameter>dbhandle</parameter> specifies the database handle that you
wish to extend, <parameter>function_name</parameter> specifies the name
of the function that you will use in your SQL statements,
<parameter>callback</parameter> is any valid PHP callback to specify a
PHP function that should be called to handle the SQL function.
Callback function should return a type understood by SQLite (i.e.
<link linkend="language.types.intro">scalar type</link>).
The optional parameter <parameter>num_args</parameter> is used as a hint
by the SQLite expression parser/evaluator. It is recommended that you
specify a value if your function will only ever accept a fixed number of
parameters.
Function), so that it can be called from within your SQL statements.
</para>
<para>
The UDF can be used in any SQL statement that can call functions, such as
SELECT and UPDATE statements and also in triggers.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>function_name</parameter></term>
<listitem>
<para>
The name of the function used in SQL statements.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>callback</parameter></term>
<listitem>
<para>
Callback function to handle the defined SQL function.
</para>
<note>
<simpara>
Callback functions should return a type understood by SQLite (i.e.
<link linkend="language.types.intro">scalar type</link>).
</simpara>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>num_args</parameter></term>
<listitem>
<para>
Hint to the SQLite parser if the callback function accepts a
predetermined number of arguments.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
&sqlite.param-compat;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_create_function</function> example</title>
@ -131,11 +172,18 @@ $rows = sqlite_array_query($dbhandle, "SELECT php('md5', filename) from files");
SQL functions.
</para>
</tip>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_create_aggregate</function>.
<simplelist>
<member><function>sqlite_create_aggregate</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.sqlite-current">
<refnamediv>
<refname>sqlite_current</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->current</refname>
<refpurpose>Fetches the current row from a result set as an array</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>sqlite_current</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -38,20 +39,58 @@
to the next row prior to returning the data; it returns the data from the
current position only.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
If the current position is beyond the final row, this function returns
&false;
<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>
&sqlite.result-type;
&sqlite.case-fold;
&sqlite.decode-bin;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
See also <function>sqlite_seek</function>,
<function>sqlite_next</function>, and
<function>sqlite_fetch_array</function>.
Returns an array of the current row from a result set; &false; if the
current position is beyond the final row.
</para>
&sqlite.case-fold;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_seek</function></member>
<member><function>sqlite_next</function></member>
<member><function>sqlite_fetch_array</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.sqlite-error-string">
<refnamediv>
<refname>sqlite_error_string</refname>
<refpurpose>Returns the textual description of an error code</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sqlite_error_string</methodname>
<methodparam><type>int</type><parameter>error_code</parameter></methodparam>
@ -16,11 +17,18 @@
<parameter>error_code</parameter> returned from
<function>sqlite_last_error</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_last_error</function>.
<simplelist>
<member><function>sqlite_last_error</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.sqlite-escape-string">
<refnamediv>
<refname>sqlite_escape_string</refname>
<refpurpose>Escapes a string for use as a query parameter</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sqlite_escape_string</methodname>
<methodparam><type>string</type><parameter>item</parameter></methodparam>
@ -47,8 +48,14 @@
<function>sqlite_udf_encode_binary</function> instead.
</simpara>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_udf_encode_binary</function>.
<simplelist>
<member><function>sqlite_udf_encode_binary</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.sqlite-exec">
<refnamediv>
<refname>sqlite_exec</refname>
<refname>SQLiteDatabase->exec</refname>
<refpurpose>Executes a result-less query against a given database</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_exec</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -31,10 +32,6 @@
a given database handle (specified by the <parameter>dbhandle</parameter>
parameter).
</para>
<para>
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>
<warning>
<simpara>
SQLite <emphasis>will</emphasis> execute multiple queries separated by
@ -42,9 +39,49 @@
loaded from a file or have embedded in a script.
</simpara>
</warning>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
The query to be executed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
&sqlite.param-compat;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
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>
&sqlite.case-fold;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_exec</function> example</title>
<title>Procedural example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -55,8 +92,16 @@ if (!$query) {
} else {
echo 'Number of rows modified: ', sqlite_changes($dbhandle);
}
/* OO Example */
?>]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Object-oriented example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = new SQLiteDatabase('mysqlitedb');
$query = $dbhandle->exec("UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!$query) {
@ -64,19 +109,24 @@ if (!$query) {
} else {
echo 'Number of rows modified: ', $dbhandle->changes();
}
?>]]>
</programlisting>
</example>
</para>
&sqlite.param-compat;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_query</function>,
<function>sqlite_unbuffered_query</function> and
<function>sqlite_array_query</function>.
<simplelist>
<member><function>sqlite_query</function></member>
<member><function>sqlite_unbuffered_query</function></member>
<member><function>sqlite_array_query</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,21 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.sqlite-factory">
<refnamediv>
<refname>sqlite_factory</refname>
<refpurpose>Opens a SQLite database and returns a SQLiteDatabase object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<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>
<para>
Returns a SQLiteDatabase object on success, &null; on error.
</para>
<para>
<function>sqlite_factory</function> behaves similarly to
<function>sqlite_open</function> in that it opens an SQLite database or
@ -24,6 +22,53 @@
returned rather than a resource. Please see the
<function>sqlite_open</function> reference page for further usage and caveats.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
The filename of the SQLite database.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
The mode of the file. Intended to be used to open the database in
read-only mode. Presently, this parameter is ignored by the sqlite
library. The default value for mode is the octal value
<literal>0666</literal> and this is the recommended value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>error_message</parameter></term>
<listitem>
<para>
Passed by reference and is set to hold a descriptive error message
explaining why the database could not be opened if there was an error.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a SQLiteDatabase object on success, &null; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_factory</function> example</title>
@ -42,9 +87,15 @@ $dbhandle->query('SELECT user_id, username FROM users');
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_open</function> and
<function>sqlite_popen</function>.
<simplelist>
<member><function>sqlite_open</function></member>
<member><function>sqlite_popen</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.sqlite-fetch-all">
<refnamediv>
<refname>sqlite_fetch_all</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->fetchAll</refname>
<refpurpose>Fetches all rows from a result set as an array of arrays</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>sqlite_fetch_all</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -39,12 +40,51 @@
<function>sqlite_unbuffered_query</function>) and then
<function>sqlite_fetch_array</function> for each row in the result set.
</para>
&sqlite.result-type;
</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 current row from a result set; &false; if the
current position is beyond the final row.
</para>
&sqlite.case-fold;
&sqlite.decode-bin;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_fetch_all</function> example</title>
<title>Procedural example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -54,8 +94,17 @@ $result = sqlite_fetch_all($query, SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email'];
}
/* OO Example */
?>
]]>
</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
@ -70,7 +119,15 @@ foreach ($result as $entry) {
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_fetch_array</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.sqlite-fetch-array">
<refnamediv>
<refname>sqlite_fetch_array</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->fetch</refname>
<refpurpose>Fetches the next row from a result set as an array</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>sqlite_fetch_array</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -36,16 +37,99 @@
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>
&sqlite.result-type;
&sqlite.case-fold;
&sqlite.decode-bin;
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_array_query</function> and
<function>sqlite_fetch_string</function>.
<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 next row from a result set; &false; if the
next position is beyond the final row.
</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_array_query</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

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.sqlite-fetch-column-types">
<refnamediv>
<refname>sqlite_fetch_column_types</refname>
@ -8,8 +8,9 @@
Return an array of column types from a particular table
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>sqlite_fetch_column_types</methodname>
<methodparam><type>string</type><parameter>table_name</parameter></methodparam>
@ -29,19 +30,53 @@
<function>sqlite_fetch_column_types</function> returns an array of column
data types from the specified <parameter>table_name</parameter> table.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<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.
<variablelist>
<varlistentry>
<term><parameter>table_name</parameter></term>
<listitem>
<para>
The table name to query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. 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>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of column data types; &false; on error.
</para>
&sqlite.case-fold;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_fetch_column_types</function> example</title>
<title>Procedural example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -52,12 +87,17 @@ $cols = sqlite_fetch_column_types('foo', $db, SQLITE_ASSOC);
foreach ($cols as $column => $type) {
echo "Column: $column Type: $type";
}
/* Output:
* Column: bar Type: VARCHAR
* Column: arf Type: TEXT
*/
/* OO Example */
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Object-oriented example</title>
<programlisting role="php">
<![CDATA[
<?php
$db = new SQLiteDatabase('mysqlitedb');
$db->query('CREATE TABLE foo (bar varchar(10), arf text)');
$cols = $db->fetchColumnTypes('foo', SQLITE_ASSOC);
@ -68,6 +108,13 @@ foreach ($cols as $column => $type) {
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Column: bar Type: VARCHAR
Column: arf Type: TEXT
]]>
</screen>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<refentry id="function.sqlite-fetch-object">
<refnamediv>
<refname>sqlite_fetch_object</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->fetchObject</refname>
<refpurpose>Fetches the next row from a result set as an object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>object</type><methodname>sqlite_fetch_object</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.sqlite-fetch-single">
<refnamediv>
<refname>sqlite_fetch_single</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->fetchSingle</refname>
<refpurpose>Fetches the first column of a result set as a string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sqlite_fetch_single</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -38,7 +39,33 @@
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;
</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>decode_binary</parameter></term>
<listitem>
&sqlite.decode-bin;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>sqlite_fetch_single</function> example</title>
@ -61,11 +88,18 @@ if ($dbhandle = sqlite_open('mysqlitedb', 0666, $sqliteerror)) {
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_fetch_array</function>.
<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

View file

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry id="function.sqlite-fetch-string">
<refnamediv>
<refname>sqlite_fetch_string</refname>
<refpurpose>Alias of <function>sqlite_fetch_single</function></refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<para>
This function is an alias of <function>sqlite_fetch_single</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.sqlite-field-name">
<refnamediv>
<refname>sqlite_field_name</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->fieldName</refname>
<refpurpose>Returns the name of a particular field</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sqlite_field_name</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -34,13 +35,41 @@
<function>sqlite_field_name</function> returns the name of that field in
the result set <parameter>result</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<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.
<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>field_index</parameter></term>
<listitem>
<para>
The ordinal column number in the result set.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the name of a field in an SQLite result set, given the ordinal
column number; &false; on error.
</para>
&sqlite.case-fold;
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,27 +1,57 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry id="function.sqlite-has-more">
<refnamediv>
<refname>sqlite_has_more</refname>
<refpurpose>Returns whether or not more rows are available</refpurpose>
<refpurpose>Finds whether or not more rows are available</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_has_more</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
<function>sqlite_has_more</function> returns &true; if there are more
rows available from the <parameter>result</parameter> handle, or &false;
otherwise.
Finds whether more rows are available from the given result set.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_num_rows</function> and
<function>sqlite_changes</function>.
<variablelist>
<varlistentry>
<term><parameter>result</parameter></term>
<listitem>
<para>
The SQLite result resource.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if there are more rows available from the
<parameter>result</parameter> handle, or &false; otherwise.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_num_rows</function></member>
<member><function>sqlite_changes</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_has_prev</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -21,19 +22,48 @@
</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;
Find whether there are more previous rows from the given result handle.
</para>
&sqlite.no-unbuffered;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also
<function>sqlite_prev</function>,
<function>sqlite_has_more</function>, and
<function>sqlite_num_rows</function>.
<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>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if there are more previous rows available from the
<parameter>result</parameter> handle, or &false; otherwise.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_prev</function></member>
<member><function>sqlite_has_more</function></member>
<member><function>sqlite_num_rows</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<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>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>sqlite_key</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -24,22 +25,73 @@
<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>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_next</function>,
<function>sqlite_current</function> and
<function>sqlite_rewind</function>.
<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>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the current row index of the buffered result set
<parameter>result</parameter>.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.0.4</entry>
<entry>
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,
not procedurally.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_next</function></member>
<member><function>sqlite_current</function></member>
<member><function>sqlite_rewind</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>sqlite_last_error</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -26,11 +27,36 @@
description of the error code can be retrieved using
<function>sqlite_error_string</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_error_string</function>.
<variablelist>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_error_string</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>sqlite_last_insert_rowid</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -32,7 +33,27 @@
</para>
</tip>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.sqlite-libencoding">
<refnamediv>
<refname>sqlite_libencoding</refname>
<refpurpose>Returns the encoding of the linked SQLite library</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sqlite_libencoding</methodname>
<void/>
@ -40,11 +41,18 @@
UTF-8 encoding.
</para>
</warning>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_libversion</function>.
<simplelist>
<member><function>sqlite_lib_version</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,24 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.sqlite-libversion">
<refnamediv>
<refname>sqlite_libversion</refname>
<refpurpose>Returns the version of the linked SQLite library</refpurpose>
</refnamediv>
<refsect1>
<refsect1 role="description">
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>sqlite_libversion</methodname>
<void/>
</methodsynopsis>
<para>
Returns the version of the linked SQLite library as a string.
Returns the version of the linked SQLite library.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_libencoding</function>.
<simplelist>
<member><function>sqlite_libencoding</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.sqlite-next">
<refnamediv>
<refname>sqlite_next</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->next</refname>
<refpurpose>Seek to the next row number</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_next</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -31,15 +32,45 @@
<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>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_seek</function>,
<function>sqlite_current</function> and
<function>sqlite_rewind</function>.
<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>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; on success, or &false; if there are no more rows.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_seek</function></member>
<member><function>sqlite_current</function></member>
<member><function>sqlite_rewind</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.sqlite-num-fields">
<refnamediv>
<refname>sqlite_num_fields</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->numFields</refname>
<refpurpose>Returns the number of fields in a result set</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>sqlite_num_fields</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -31,12 +32,36 @@
<para>
Returns the number of fields in the <parameter>result</parameter> set.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_column</function> and
<function>sqlite_num_rows</function>.
<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>
</variablelist>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_changes</function></member>
<member><function>sqlite_num_rows</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<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>
<refsect1 role="description">
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>sqlite_num_rows</methodname>
@ -24,10 +25,31 @@
Returns the number of rows in the buffered <parameter>result</parameter>
set.
</para>
&sqlite.no-unbuffered;
</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>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_num_rows</function> example</title>
<title>Procedural example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -36,8 +58,17 @@ $result = sqlite_query($db, "SELECT * FROM mytable WHERE name='John Doe'");
$rows = sqlite_num_rows($result);
echo "Number of rows: $rows";
/* OO Example */
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Object-oriented example</title>
<programlisting role="php">
<![CDATA[
<?php
$db = new SQLiteDatabase('mysqlitedb');
$result = $db->query("SELECT * FROM mytable WHERE name='John Doe'");
$rows = $result->numRows();
@ -48,12 +79,20 @@ echo "Number of rows: $rows";
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_changes</function> and
<function>sqlite_query</function>.
<simplelist>
<member><function>sqlite_changes</function></member>
<member><function>sqlite_query</function></member>
<member><function>sqlite_num_fields</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<refentry id="function.sqlite-open">
<refnamediv>
<refname>sqlite_open</refname>
<refpurpose>Opens a SQLite database and create the database if it does not exist</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>sqlite_open</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
@ -23,30 +24,59 @@
<methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam>
</constructorsynopsis>
</classsynopsis>
<para>
Opens a SQLite database or creates the database if it does not exist.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
The filename of the SQLite database. If the file does not exist, SQLite
will attempt to create it. PHP must have write permissions to the file
if data is inserted, the database schema is modified or to create the
database if it does not exist.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
The mode of the file. Intended to be used to open the database in
read-only mode. Presently, this parameter is ignored by the sqlite
library. The default value for mode is the octal value
<literal>0666</literal> and this is the recommended value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>error_message</parameter></term>
<listitem>
<para>
Passed by reference and is set to hold a descriptive error message
explaining why the database could not be opened if there was an error.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a resource (database handle) on success, &false; on error.
</para>
<para>
The <parameter>filename</parameter> parameter is the name of the
database. It can be a relative or absolute path to the file that sqlite
will use to store your data. If the file does not exist, sqlite will
attempt to create it. You <emphasis>MUST</emphasis> have write
permissions to the file if you want to insert data or modify the database
schema.
</para>
<para>
The <parameter>mode</parameter> parameter specifies the mode of the file and is
intended to be used to open the database in read-only mode.
Presently, this parameter is ignored by the sqlite library. The default
value for mode is the octal value <literal>0666</literal> and this is the
recommended value to use if you need access to the
<parameter>errmessage</parameter> parameter.
</para>
<para>
<parameter>errmessage</parameter> is passed by reference and is set to
hold a descriptive error message explaining why the database could not be
opened if there was an error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>sqlite_open</function> example</title>
@ -65,6 +95,10 @@ if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) {
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<tip>
<simpara>
On Unix platforms, SQLite is sensitive to scripts that use the fork() system call. If you
@ -100,15 +134,20 @@ if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) {
SQLite is &safemode; and open_basedir aware.
</simpara>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_popen</function>,
<function>sqlite_factory</function>,
<function>sqlite_close</function> and
<function>sqlite_query</function>.
<simplelist>
<member><function>sqlite_popen</function></member>
<member><function>sqlite_close</function></member>
<member><function>sqlite_factory</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.sqlite-popen">
<refnamediv>
<refname>sqlite_popen</refname>
@ -7,8 +7,9 @@
Opens a persistent handle to an SQLite database and create the database if it does not exist
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>sqlite_popen</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
@ -46,13 +47,66 @@
database file and perform their updates in a transaction.
</simpara>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_open</function>,
<function>sqlite_close</function> and
<function>sqlite_query</function>.
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
The filename of the SQLite database. If the file does not exist, SQLite
will attempt to create it. PHP must have write permissions to the file
if data is inserted, the database schema is modified or to create the
database if it does not exist.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
The mode of the file. Intended to be used to open the database in
read-only mode. Presently, this parameter is ignored by the sqlite
library. The default value for mode is the octal value
<literal>0666</literal> and this is the recommended value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>error_message</parameter></term>
<listitem>
<para>
Passed by reference and is set to hold a descriptive error message
explaining why the database could not be opened if there was an error.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a resource (database handle) on success, &false; on error.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_open</function></member>
<member><function>sqlite_close</function></member>
<member><function>sqlite_factory</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_prev</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -22,18 +23,47 @@
</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.
<parameter>result</parameter> handle to the previous row.
</para>
&sqlite.no-unbuffered;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also
<function>sqlite_has_prev</function>,
<function>sqlite_rewind</function>, and
<function>sqlite_next</function>.
<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>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; on success, or &false; if there are no more previous rows.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_has_prev</function></member>
<member><function>sqlite_rewind</function></member>
<member><function>sqlite_next</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.sqlite-query">
<refnamediv>
<refname>sqlite_query</refname>
<refname>SQLiteDatabase->query</refname>
<refpurpose>Executes a query against a given database and returns a result handle</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>sqlite_query</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -28,9 +29,39 @@
</classsynopsis>
<para>
Executes an SQL statement given by the <parameter>query</parameter> against
a given database handle (specified by the <parameter>dbhandle</parameter>
parameter).
a given database handle.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
The query to be executed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
&sqlite.param-compat;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This function will return a result handle or &false; on failure.
For queries that return rows, the result handle can then be used with
@ -50,7 +81,10 @@
recommended that you use the much higher performance
<function>sqlite_unbuffered_query</function> instead.
</para>
&sqlite.param-compat;
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<warning>
<simpara>
SQLite <emphasis>will</emphasis> execute multiple queries separated by
@ -67,12 +101,19 @@
be &true; for success or it might return a result handle).
</simpara>
</warning>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_unbuffered_query</function> and
<function>sqlite_array_query</function>.
<simplelist>
<member><function>sqlite_unbuffered_query</function></member>
<member><function>sqlite_array_query</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.sqlite-rewind">
<refnamediv>
<refname>sqlite_rewind</refname>
<refname>SQLiteResult->rewind</refname>
<refpurpose>Seek to the first row number</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_rewind</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -22,17 +23,47 @@
</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.
given result set.
</para>
&sqlite.no-unbuffered;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_next</function>,
<function>sqlite_current</function>, and
<function>sqlite_seek</function>.
<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>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &false; if there are no rows in the result set, &true; otherwise.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_next</function></member>
<member><function>sqlite_current</function></member>
<member><function>sqlite_seek</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_seek</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -23,17 +24,57 @@
</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.
<parameter>rownum</parameter>.
</para>
&sqlite.no-unbuffered;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_next</function>,
<function>sqlite_current</function> and
<function>sqlite_rewind</function>.
<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>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>rownum</parameter></term>
<listitem>
<para>
The ordinal row number to seek to. The row number is zero-based (0 is
the first row).
</para>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &false; if the row does not exist, &true; otherwise.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_next</function></member>
<member><function>sqlite_current</function></member>
<member><function>sqlite_rewind</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<refentry id="function.sqlite-single-query">
<refnamediv>
<refname>sqlite_single_query</refname>
@ -8,8 +8,9 @@
Executes a query and returns either an array for one single column or the value of the first row
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>sqlite_single_query</methodname>
<methodparam><type>resource</type><parameter>db</parameter></methodparam>

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.sqlite-udf-decode-binary">
<refnamediv>
<refname>sqlite_udf_decode_binary</refname>
<refpurpose>Decode binary data passed as parameters to an UDF</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sqlite_udf_decode_binary</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
@ -26,6 +27,10 @@
PHP does not perform this encode/decode operation automatically as it would
severely impact performance if it did.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>binary-safe max_length aggregation function example</title>
@ -73,13 +78,20 @@ var_dump(sqlite_array_query($db, 'SELECT max_len(a) from strings'));
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_udf_encode_binary</function>,
<function>sqlite_create_function</function> and
<function>sqlite_create_aggregate</function>.
<simplelist>
<member><function>sqlite_udf_encode_binary</function></member>
<member><function>sqlite_create_function</function></member>
<member><function>sqlite_create_aggregate</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry id="function.sqlite-udf-encode-binary">
<refnamediv>
<refname>sqlite_udf_encode_binary</refname>
<refpurpose>Encode binary data before returning it from an UDF</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sqlite_udf_encode_binary</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
@ -33,14 +34,21 @@
<function>sqlite_udf_encode_binary</function> instead!
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>sqlite_udf_decode_binary</function>,
<function>sqlite_escape_string</function>,
<function>sqlite_create_function</function> and
<function>sqlite_create_aggregate</function>.
<simplelist>
<member><function>sqlite_udf_decode_binary</function></member>
<member><function>sqlite_escape_string</function></member>
<member><function>sqlite_create_function</function></member>
<member><function>sqlite_create_aggregate</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<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>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>sqlite_unbuffered_query</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
@ -46,12 +47,57 @@
returned from <function>sqlite_unbuffered_query</function>.
</para>
</note>
&sqlite.param-compat;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_query</function>.
<variablelist>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
The query to be executed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dbhandle</parameter></term>
<listitem>
<para>
The SQLite Database resource; returned from <function>sqlite_open
</function> when used procedurally. This parameter is not required
when using the object-oriented method.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
&sqlite.param-compat;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a result handle or &false; on failure.
</para>
<para>
<function>sqlite_unbuffered_query</function> returns a sequential
forward-only result set that can only be used to read each row, one after
the other.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_query</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<refentry id="function.sqlite-valid">
<refnamediv>
<refname>sqlite_valid</refname>
@ -7,8 +7,9 @@
<refname>SQLiteUnbuffered->valid</refname>
<refpurpose>Returns whether more rows are available</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>sqlite_valid</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -29,16 +30,47 @@
</methodsynopsis>
</classsynopsis>
<para>
<function>sqlite_valid</function> returns &true; if there are more
rows available from the <parameter>result</parameter> handle, or &false;
otherwise.
Finds whether more rows are available from the given result handle.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>sqlite_num_rows</function> and
<function>sqlite_changes</function>.
<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>
&sqlite.no-unbuffered;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if there are more rows available from the
<parameter>result</parameter> handle, or &false; otherwise.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sqlite_num_rows</function></member>
<member><function>sqlite_changes</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View file

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<section id="sqlite.configuration">
&reftitle.runtime;
&extension.runtime;
<para>
<table>
<title>SQLite Configuration Options</title>
<title>SQLite &ConfigureOptions;</title>
<tgroup cols="3">
<thead>
<row>
<entry>Name</entry>
<entry>Default</entry>
<entry>Changeable</entry>
<entry>&Name;</entry>
<entry>&Default;</entry>
<entry>&Changeable;</entry>
</row>
</thead>
<tbody>