1. Go to this page and download the library: Download parvezmrobin/db-model 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/ */
$user = \DbModel\Model::find('users', '1', 'user_primary_key');
$posts = $user->oneToMany('posts', 'user_id', 'user_primary_key');
// To retrieve Post that contains 'ghost' in title
$posts = $user->oneToMany('posts', 'user_id', 'user_primary_key',
'title LIKE "%ghost%"');
// To retrieve title and body only
$posts = $user->oneToMany('posts', 'user_id', 'user_primary_key',
'TRUE', 'title, body');