php-doc-en/reference/sqlite/reference.xml
Hannes Magnusson c030e2adf7 Upgrade to DocBook5:
- All id attributes are now xml:id
 - Add docbook namespace to all root elements
 - Replace <ulink /> with <link xlink:href />
 - Minor markup fixes here and there


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
2007-06-20 22:25:43 +00:00

313 lines
13 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.24 $ -->
<!-- Purpose: database.vendors -->
<!-- Membership: bundled -->
<reference xml:id="ref.sqlite" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>SQLite Functions</title>
<titleabbrev>SQLite</titleabbrev>
<partintro>
<section xml:id="sqlite.intro">
&reftitle.intro;
<para>
This is an extension for the SQLite Embeddable SQL Database Engine.
SQLite is a C library that implements an embeddable SQL database engine.
Programs that link with the SQLite library can have SQL database access
without running a separate RDBMS process.
</para>
<para>
SQLite is not a client library used to connect to a big database server.
SQLite is the server. The SQLite library reads and writes directly to and from
the database files on disk.
</para>
<note>
<para>
For further information see the SQLite Website
(<link xlink:href="&url.sqlite;">&url.sqlite;</link>).
</para>
</note>
</section>
<section xml:id="sqlite.install">
<title>Installation</title>
<para>
Read the INSTALL file, which comes with the package. Or just use the PEAR
installer with <command>pear install sqlite</command>.
SQLite itself is already included, You do not need to install
any additional software.
</para>
<para>
Windows users may download the DLL version of the SQLite extension here:
(<link xlink:href="&url.pecl.get.win;php_sqlite.dll">php_sqlite.dll</link>).
</para>
<para>
In PHP 5, the SQLite extension and the engine itself are bundled and
compiled by default. However, since PHP 5.1.0 you need to manually
activate the extension in &php.ini; (because it is now bundled as
shared). Moreover, since PHP 5.1.0 SQLite depends on <link
linkend="ref.pdo">PDO</link> it must be enabled too, by adding the
following lines to &php.ini; (in order):
<informalexample>
<programlisting role="ini">
<![CDATA[
extension=php_pdo.dll
extension=php_sqlite.dll
]]>
</programlisting>
</informalexample>
On Linux or Unix operating systems, if you build PDO as a shared
extension, you must build SQLite as a shared extension using the
<command>--with-sqlite=shared</command> configure option.
</para>
<para>
SQLite 3 is supported through <link
linkend="ref.pdo-sqlite">PDO SQLite</link>.
</para>
<note>
<title>Windows installation for unprivileged accounts</title>
<para>
On Windows operating systems, unprivileged accounts don't have the
<varname>TMP</varname> environment variable set by default. This will
make sqlite create temporary files in the windows directory, which is
not desirable. So, you should set the <varname>TMP</varname> environment
variable for the web server or the user account the web server is
running under. If Apache is your web server, you can accomplish this via
a <command>SetEnv</command> directive in your &httpd.conf; file. For
example:
<informalexample>
<programlisting role="apache-conf">
<![CDATA[
SetEnv TMP c:/temp
]]>
</programlisting>
</informalexample>
If you are unable to establish this setting at the server
level, you can implement the setting in your script:
<informalexample>
<programlisting role="php">
<![CDATA[
putenv('TMP=C:/temp');
]]>
</programlisting>
</informalexample>
The setting must refer to a directory that the web server
has permission to create files in and subsequently write
to and delete the files it created.
Otherwise, you may receive the following error message:
<computeroutput>
malformed database schema -
unable to open a temporary database file for storing temporary tables
</computeroutput>
</para>
</note>
</section>
<section xml:id="sqlite.requirements">
&reftitle.required;
<para>
In order to have these functions available, you must compile PHP with
SQLite support, or load the SQLite extension dynamically from your
&php.ini;.
</para>
</section>
<section xml:id="sqlite.resources">
&reftitle.resources;
<para>
There are two resources used in the SQLite Interface. The first one is the
database connection, the second one the result set.
</para>
</section>
&reference.sqlite.constants;
<section xml:id="sqlite.classes">
&reftitle.classes;
<section xml:id="sqlite.class.sqlitedatabase">
<title><classname>SQLiteDatabase</classname></title>
<para>
Represents an opened SQLite database.
</para>
<section xml: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 xml: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'>lastError</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 xml:id="sqlite.class.sqliteresult">
<title><classname>SQLiteResult</classname></title>
<para>
Represents a buffered SQLite result set.
</para>
<section xml: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 xml:id="sqlite.class.sqliteunbuffered">
<title><classname>SQLiteUnbuffered</classname></title>
<para>
Represents an unbuffered SQLite result set. Unbuffered results sets are sequential, forward-seeking only.
</para>
<section xml: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>
&reference.sqlite.functions;
</reference>
<!-- 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
indent-tabs-mode:nil
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
-->