PHP: PDO_SQLITE DSN - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

PDO::sqliteCreateAggregate SQLite (PDO)

Last updated: Fri, 26 Jan 2007

view this page in

# PDO_SQLITE DSN

(no version information, might be only in CVS)

PDO_SQLITE DSN -- Connecting to SQLite databases

## Описание

The PDO_SQLITE Data Source Name (DSN) is composed of the following elements:

DSN prefix (SQLite 3)

  The DSN prefix is `sqlite:`.

  - To access a database on disk, append the absolute path to the DSN prefix.

  - To create a database in memory, append `memory:` to the DSN prefix.

DSN prefix (SQLite 2)

  The SQLite 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 SQLite extension in previous versions of PHP.

  > Замечание: 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.

  The DSN prefix for connecting to SQLite 2 databases is `sqlite2:`.

  - To access a database on disk, append the absolute path to the DSN prefix.

  - To create a database in memory, append `memory:` to the DSN prefix.

## Примеры

Пример 1. PDO_SQLITE DSN examples

The following examples show PDO_SQLITE DSN for connecting to SQLite databases:

    sqlite:/opt/databases/mydb.sq3
    sqlite::memory:
    sqlite2:/opt/databases/mydb.sq2
    sqlite2::memory:

add a note User Contributed Notes
PDO_SQLITE DSN
rick
30-Oct-2006 10:51
`Don't forget "extension=php_pdo_sqlite.dll" has to be enabled in php.ini (if you use xampp is will be disabled by default) .`
add a note
PDO::sqliteCreateAggregate SQLite (PDO)

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 11:33:19 2007 PST