2005-08-12 02:03:50 +00:00
|
|
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
2005-09-18 14:06:34 +00:00
|
|
|
<!-- $Revision: 1.9 $ -->
|
2005-09-04 19:39:32 +00:00
|
|
|
<!-- Purpose: database.vendors -->
|
|
|
|
<!-- Membership: bundled, pecl -->
|
|
|
|
|
2005-08-12 02:03:50 +00:00
|
|
|
<reference id="ref.pdo-sqlite">
|
|
|
|
<title>SQLite Functions (PDO_SQLITE)</title>
|
2005-08-20 23:14:57 +00:00
|
|
|
<titleabbrev>SQLite (PDO)</titleabbrev>
|
2005-08-12 02:03:50 +00:00
|
|
|
<partintro>
|
|
|
|
|
|
|
|
<section id="pdo-sqlite.intro">
|
|
|
|
&reftitle.intro;
|
|
|
|
<para>
|
2005-09-11 06:17:09 +00:00
|
|
|
PDO_SQLITE is a driver that implements the <link linkend="ref.pdo">PHP
|
|
|
|
Data Objects (PDO) interface</link> to enable access to SQLite 3 databases.
|
2005-09-09 04:10:15 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
In PHP 5.1, the <link linkend="ref.sqlite">SQLite</link> extension also
|
|
|
|
provides a driver for SQLite 2 databases; while it is not technically a
|
2005-09-10 16:45:53 +00:00
|
|
|
part of the PDO_SQLITE driver, it behaves similarly, so it is
|
|
|
|
documented alongside it. The SQLite 2 driver for PDO is provided
|
|
|
|
primarily to make it easier to import legacy sqlite 2 database files into
|
|
|
|
an application that uses the faster, more efficient sqlite 3 driver. As
|
|
|
|
a result, the SQLite 2 driver is not as feature-rich as the SQLite 3
|
|
|
|
driver.
|
2005-08-12 02:03:50 +00:00
|
|
|
</para>
|
|
|
|
</section>
|
|
|
|
</partintro>
|
|
|
|
|
|
|
|
<refentry id="ref.pdo-sqlite.connection">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>PDO_SQLITE DSN</refname>
|
2005-08-20 23:14:57 +00:00
|
|
|
<refpurpose>Connecting to SQLite databases</refpurpose>
|
2005-08-12 02:03:50 +00:00
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<para>
|
|
|
|
The PDO_SQLITE Data Source Name (DSN) is composed of the following elements:
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>DSN prefix (SQLite 3)</term>
|
|
|
|
<listitem>
|
2005-08-12 03:31:18 +00:00
|
|
|
<para>
|
|
|
|
The DSN prefix is <userinput>sqlite:</userinput>.
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To access a database on disk, append the absolute path to the
|
|
|
|
DSN prefix.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To create a database in memory, append <literal>memory:</literal>
|
|
|
|
to the DSN prefix.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
2005-08-12 02:03:50 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>DSN prefix (SQLite 2)</term>
|
|
|
|
<listitem>
|
2005-08-12 03:31:18 +00:00
|
|
|
<para>
|
2005-09-09 04:10:15 +00:00
|
|
|
The <link linkend="ref.sqlite">SQLite</link> extension in
|
|
|
|
PHP 5.1 provides a PDO driver that supports accessing and creating SQLite 2
|
|
|
|
databases. This enables you to access databases you may have created
|
2005-08-12 03:31:18 +00:00
|
|
|
with the <link linkend="ref.sqlite">SQLite</link> extension in
|
|
|
|
previous versions of PHP.
|
|
|
|
</para>
|
2005-09-09 04:10:15 +00:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
The sqlite2 driver is only available in PHP 5.1 if you have enabled
|
|
|
|
both PDO and ext/sqlite. It is not currently available via PECL.
|
|
|
|
</para>
|
|
|
|
</note>
|
2005-08-12 03:31:18 +00:00
|
|
|
<para>
|
|
|
|
The DSN prefix for connecting to SQLite 2 databases is
|
|
|
|
<userinput>sqlite2:</userinput>.
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To access a database on disk, append the absolute path to the
|
|
|
|
DSN prefix.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To create a database in memory, append <literal>memory:</literal>
|
|
|
|
to the DSN prefix.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
2005-08-12 02:03:50 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>PDO_SQLITE DSN examples</title>
|
|
|
|
<para>
|
|
|
|
The following examples show PDO_SQLITE DSN for connecting to
|
|
|
|
SQLite databases:
|
|
|
|
<programlisting><![CDATA[
|
|
|
|
sqlite:/opt/databases/mydb.sq3
|
2005-09-09 04:10:15 +00:00
|
|
|
sqlite::memory:
|
2005-08-12 02:03:50 +00:00
|
|
|
sqlite2:/opt/databases/mydb.sq2
|
2005-09-09 04:10:15 +00:00
|
|
|
sqlite2::memory:
|
2005-08-12 02:03:50 +00:00
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
2005-09-10 15:44:37 +00:00
|
|
|
&reference.pdo-sqlite.functions;
|
|
|
|
|
2005-08-12 02:03:50 +00:00
|
|
|
</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
|
|
|
|
-->
|