SQLite
in package
SQLite wrapper.
This is just another SQLite database access wrapper class. It can establish connections to the SQLite database, execute SQL queries, and return results. Native drivers are great if you are only using one database in your application, so this class uses the native SQLite driver.
$db = new \netico\Bones\SQLite();
$db->sql("SELECT * FROM pages ORDER BY [rowid] ASC;");
$db->close();
var_dump($db->data);
Tags
Table of Contents
- $data : array<string|int, array<string|int, mixed>>
- This array contains the results of the query.
- __construct() : mixed
- This method retrieves the SQLite database path from the configuration file and then opens a connection in read mode.
- close() : void
- This method closes the connection to the database.
- SQL() : void
- It runs a SQL query on a given database and builds an array of the results.
Properties
$data
This array contains the results of the query.
public
array<string|int, array<string|int, mixed>>
$data
Methods
__construct()
This method retrieves the SQLite database path from the configuration file and then opens a connection in read mode.
public
__construct() : mixed
Return values
mixed —close()
This method closes the connection to the database.
public
close() : void
Return values
void —SQL()
It runs a SQL query on a given database and builds an array of the results.
public
SQL(string $query) : void
Parameters
- $query : string