1. Go to this page and download the library: Download roolith/database 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/ */
roolith / database example snippets
use Roolith\Store\Database;
$db = new Database();
$db->connect([
'host' => 'host',
'name' => 'dbname',
'user' => 'username',
'pass' => 'password',
]);
// Get all users
$users = $db->query("SELECT * FROM users")->get();
print_r($users);
// Get all usernames
$usernames = $db->table('users')->select([
'field' => 'name',
])->get();
print_r($usernames);
// Disconnect
$db->disconnect();