1. Go to this page and download the library: Download sevens/jsondb 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/ */
use Seven\JsonDB\JsonDB;
$newDB = JsonDB::make(string $directory, $database): string;
#returns database name if successfully created
$schema = [
'name', 'email', 'password'
];
$table->createTable($table, $schema);
//To use the 'save' method, you need to use a schema when creating a table
use Seven\JsonDB\JsonDB;
$newDB = JsonDB::list(string $directory): array;
#returns an array of databases found
use Seven\JsonDB\JsonDB;
$newDB = JsonDB::count(string $directory): int;
#returns number of databases found
use Seven\JsonDB\JsonDB;
$newDB = JsonDB::delete($directory, $db): bool;
#returns true name if successfully deleted
use Seven\JsonDB\JsonDB;
$newDB = JsonDB::empty($directory, $db): void;
#returns database name if successfully created
use Seven\JsonDB\Table;
$table->generateId(Table::TYPE_STRING || Table::TYPE_INT);
//default is Table::TYPE_STRING