PHP code example of eril / tbl-class

1. Go to this page and download the library: Download eril/tbl-class 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/ */

    

eril / tbl-class example snippets


SELECT * FROM users WHERE created_at > ?

Tbl::users                // users
Tbl::users__created_at    // created_at
Tbl::fk__posts__users     // user_id 
Tbl::on__contacts__users  // contacts.user_id = users.id

Tbl::users                       // returns "users"
Tbl::users('u')                    // returns "users AS u"
Tbl::users__email                // returns "email"
Tbl::fk__users__roles            // returns "role_id" or whataver you named it in DB
Tbl::on__users__roles()          // returns "users.role_id = roles.id"
Tbl::on__users__roles('u', 'r')  // // returns "u.role_id = r.id"
bash
composer dump-autoload