1. Go to this page and download the library: Download walnut/lib_dbquery 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/ */
walnut / lib_dbquery example snippets
$query = new FixedQuery("SELECT * FROM users WHERE is_active = 1");
$result = $query->execute($queryExecutor);
$result->all(); //all active users
$query = new PreparedQuery("SELECT * FROM users WHERE id = :id", ['id']);
$result = $query->execute($queryExecutor, ['id' => 5]);
$result->first(); //user with id 5 (or null if it does not exist)
$query = new Placeholder("SELECT * FROM users WHERE name LIKE **__name__**", ['name']);
$result = $query->execute($queryExecutor, null, ['name' => '%john%']);
$result->all(); //all user with name including "john"