1. Go to this page and download the library: Download docnet/php-dbal 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/ */
docnet / php-dbal example snippets
$settings = new \Docnet\DB\ConnectionSettings('127.0.0.1', 'root', 'password', 'dbname');
$db = new \Docnet\DB($settings);
$records = $db->fetchAll("SELECT * FROM tblData");
$record = $db->fetchOne("SELECT * FROM tblData WHERE intKey = ?", 84);
$foo = $db->fetchOne("SELECT * FROM tblData WHERE intKey = ?", 84, 'Foo');
$records = $db->prepare("SELECT * FROM tblData WHERE intKey > ?id AND vchName = ?name")
->bindInt('id', 3)
->bindString('name', 'Barry')
->setResultClass('\\Docnet\\Bar')
->fetchAll();