1. Go to this page and download the library: Download phenixphp/sqlite library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phenixphp / sqlite example snippets
use Phenix\Sqlite\SqliteConfig;
$config = new SqliteConfig(
database: __DIR__ . '/database.db',
);
$config = new SqliteConfig(
database: ':memory:',
);
declare(strict_types=1);
use Phenix\Sqlite\SqliteConfig;
use function Phenix\Sqlite\connect;
$config = new SqliteConfig(
database: __DIR__ . '/database.db',
);
$connection = connect($config);
// ... use connection ...
$connection->close();
$connection->execute(
'CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT NOT NULL
)'
);