1. Go to this page and download the library: Download nahid/crudx 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/ */
$crud->table('users')->where('role', '=', 'author')->all()->result();
//generated SQL String: SELECT * FROM users WHERE role='author'
$crud->table('users')->where('role', '=', 'author')->where('age','>',17)->all()->result();
//generated SQL String: SELECT * FROM users WHERE role='author' AND age>17
$crud->table('users')->where('role', '=', 'author')->get(['name', 'username'])->result();
//generated SQL String: SELECT name, username FROM users WHERE role='author'
$crud->table('posts')->join('users', 'posts.user_id','=', 'users.id')->get(['post', 'name'])->result();
//generated SQL String: SELECT post, name FROM posts INNER JOIN users on posts.user_id=users.id