1. Go to this page and download the library: Download eznio/db 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/ */
eznio / db example snippets
// Initializing database-specific driver
$driver = new \eznio\db\drivers\Sqlite('db/test.sqlite3');
// Creating Entity Manager
$em = new \eznio\db\EntityManager($driver);
// Getting query repository by table name
$repo = $em->getRepository('test');
// Getting ActiveRecord entity of table row with id = 1
$entity =$repo->findOneById(1);
// Updating and saving entity
$entity->field = 'new value';
$entity->save();
$driver->query(
'SELECT * FROM USERS WHERE name = ? AND age = ?',
['John', 26]
);
$driver->query(
'SELECT * FROM USERS WHERE name = :name: AND age = :age:',
['age' => 26, 'name' => 'John']
);