1. Go to this page and download the library: Download ocolin/easydb 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/ */
ocolin / easydb example snippets
// Setting up variables manually for visual purposes
$_ENV['PREFIX_DB_HOST'] = 'localhost';
$_ENV['PREFIX_DB_NAME'] = 'mydb';
$_ENV['PREFIX_DB_USER'] = 'admin';
$_ENV['PREFIX_DB_PASS'] = 'password1234';
$_ENV['PREFIX_DB_PORT'] = 3306 // This is the default so does not need to be set.
$prefix_db = Ocolin\EasyDB\DB::fromEnv( prefix: 'PREFIX' );
$pdo_handler = Ocolin\EasyDB\DB::connect(
host: 'localhost',
name: 'mydb',
user: 'admin',
pass: 'password1234',
port: 3306 // This is default and does not need to be set.
);