SQLite3
class SQLite3 (View source)
A class that interfaces SQLite 3 databases.
Constants
OK |
|
DENY |
|
IGNORE |
|
CREATE_INDEX |
|
CREATE_TABLE |
|
CREATE_TEMP_INDEX |
|
CREATE_TEMP_TABLE |
|
CREATE_TEMP_TRIGGER |
|
CREATE_TEMP_VIEW |
|
CREATE_TRIGGER |
|
CREATE_VIEW |
|
DELETE |
|
DROP_INDEX |
|
DROP_TABLE |
|
DROP_TEMP_INDEX |
|
DROP_TEMP_TABLE |
|
DROP_TEMP_TRIGGER |
|
DROP_TEMP_VIEW |
|
DROP_TRIGGER |
|
DROP_VIEW |
|
INSERT |
|
PRAGMA |
|
READ |
|
SELECT |
|
TRANSACTION |
|
UPDATE |
|
ATTACH |
|
DETACH |
|
ALTER_TABLE |
|
REINDEX |
|
ANALYZE |
|
CREATE_VTABLE |
|
DROP_VTABLE |
|
FUNCTION |
|
SAVEPOINT |
|
COPY |
|
RECURSIVE |
|
Methods
Opens an SQLite database
Closes the database connection
Executes a result-less query against a given database
Returns the SQLite3 library version as a string constant and as a number
Returns the row ID of the most recent INSERT into the database
Returns the numeric result code of the most recent failed SQLite request
Returns English text describing the most recent failed SQLite request
Sets the busy connection handler
Attempts to load an SQLite extension library
Returns the number of database rows that were changed (or inserted or deleted) by the most recent SQL statement
Returns a string that has been properly escaped
Prepares an SQL statement for execution
Executes an SQL query
Executes a query and returns a single result
Registers a PHP function for use as an SQL scalar function
Registers a PHP function for use as an SQL aggregate function
Registers a PHP function for use as an SQL collating function
Opens a stream resource to read a BLOB
Enable throwing exceptions
Instantiates an SQLite3 object and opens an SQLite 3 database
No description
No description
No description
Details
void
open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = '')
Opens an SQLite database
bool
close()
Closes the database connection
bool
exec(string $query)
Executes a result-less query against a given database
static array
version()
Returns the SQLite3 library version as a string constant and as a number
int
lastInsertRowID()
Returns the row ID of the most recent INSERT into the database
int
lastErrorCode()
Returns the numeric result code of the most recent failed SQLite request
string
lastErrorMsg()
Returns English text describing the most recent failed SQLite request
bool
busyTimeout(int $milliseconds)
Sets the busy connection handler
bool
loadExtension(string $name)
Attempts to load an SQLite extension library
int
changes()
Returns the number of database rows that were changed (or inserted or deleted) by the most recent SQL statement
static string
escapeString(string $string)
Returns a string that has been properly escaped
SQLite3Stmt|false
prepare(string $query)
Prepares an SQL statement for execution
SQLite3Result|false
query(string $query)
Executes an SQL query
mixed
querySingle(string $query, bool $entireRow = false)
Executes a query and returns a single result
bool
createFunction(string $name, mixed $callback, int $argCount = -1, int $flags = 0)
Registers a PHP function for use as an SQL scalar function
bool
createAggregate(string $name, mixed $stepCallback, mixed $finalCallback, int $argCount = -1)
Registers a PHP function for use as an SQL aggregate function
bool
createCollation(string $name, callable $callback)
Registers a PHP function for use as an SQL collating function
resource|false
openBlob(string $table, string $column, int $rowid, string $database = 'main', int $flags = SQLITE3_OPEN_READONLY)
Opens a stream resource to read a BLOB
bool
enableExceptions(bool $enable = false)
Enable throwing exceptions
__construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = '')
Instantiates an SQLite3 object and opens an SQLite 3 database
int
lastExtendedErrorCode()
No description
bool
enableExtendedResultCodes(bool $enable = true)
No description
bool
backup(SQLite3 $destination, string $sourceDatabase = 'main', string $destinationDatabase = 'main')
No description
bool
setAuthorizer(callable|null $callback)
No description