1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.9 $ -->
<!-- Purpose: database.vendors -->
<!-- Membership: bundled, pecl -->
<reference id="ref.pdo-sqlite">
<title>SQLite Functions (PDO_SQLITE)</title>
<titleabbrev>SQLite (PDO)</titleabbrev>
<partintro>
<section id="pdo-sqlite.intro">
&reftitle.intro;
<para>
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.
</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
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.
</para>
</section>
</partintro>
<refentry id="ref.pdo-sqlite.connection">
<refnamediv>
<refname>PDO_SQLITE DSN</refname>
<refpurpose>Connecting to SQLite databases</refpurpose>
</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>
<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>
</listitem>
</varlistentry>
<varlistentry>
<term>DSN prefix (SQLite 2)</term>
<listitem>
<para>
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
with the <link linkend="ref.sqlite">SQLite</link> extension in
previous versions of PHP.
</para>
<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>
<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>
</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
sqlite::memory:
sqlite2:/opt/databases/mydb.sq2
sqlite2::memory:
]]>
</programlisting>
</para>
</example>
</para>
</refsect1>
</refentry>
&reference.pdo-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
-->
|