Home > PHP > Function > SQLite > sqlite_popen()

sqlite_popen()

sqlite_popen - Opens a persistent handle to an SQLite database and create the database if it does not exist

Syntax

resource sqlite_popen (string $filename, int $mode, string &$error_message)

Arguments

  • filename - 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.
  • mode - 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 0666and this is the recommended value.
  • error_message - 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.

Description

This function behaves identically to sqlite_open() except that is uses the persistent resource mechanism of PHP. For information about the meaning of the parameters, read the sqlite_open() manual page.

Version

PHP 5, PECL sqlite >= 1.0.0

Return value

Returns a resource (database handle) on success, FALSE on error.