Object oriented style (constructor):
$filename
[, int $mode
= 0666 [, string &$error_message
]] )Opens an SQLite database or creates the database if it does not exist.
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.
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 0666 and this is the recommended value.
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.
Returns a resource (database handle) on success, FALSE
on error.
<?php if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))'); sqlite_query($db, "INSERT INTO foo VALUES ('fnord')"); $result = sqlite_query($db, 'select bar from foo'); var_dump(sqlite_fetch_array($result)); } else { die($sqliteerror); } ?>
Please login to continue.