1. Go to this page and download the library: Download czproject/innudb 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/ */
czproject / innudb example snippets
php
$pathToFile = __DIR__ . '/data.php'; // see file content below
$loader = new Cz\InnuDb\Loader;
$innudb = new Cz\InnuDb\InnuDb($loader, $pathToFile);
$persons = $innudb->createCollection('persons');
foreach($persons as $id => $item)
{
var_dump($item);
}
// $persons->getCount();
//
// $persons->limit(limit);
// $persons->limit(limit, offset);
//
// $persons->sort('column'); // ASC is default
// $persons->sort('column', 'ASC'); // or order('column')
// $persons->sort('column', 'DESC'); // ASC is default
// $persons->sort(array(
// 'column' => 'ASC', // or 'DESC'
// ));
// $persons->sort('name')->sort('age', 'DESC'); // fluent interface
//
// $persons->where('column', 'value'); // column = value
// $persons->where('column >', 'value'); // column > value
// $persons->where('column <=', 'value'); // column <= value
// $persons->where('column', 'value')->where('column2 >', 'value2'); // fluent interface: column = value AND column2 > value2
// $persons->where(array(
// 'column' => 'value', // column = value
// 'column2 <=' => 'value2', // AND column2 <= value2
// ));