PHP code example of phptricks / database_class

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

    

phptricks / database_class example snippets


use PHPtricks\Orm\Model;
class UserModel extends Model
{
    protected $_table = 'users';
}

$user = new UserModel();
$allUsers = $user->select();

$user = new UsersModel();
$user->insert([
    'username' => 'al-anzawi',
    'email' => '[email protected]'
]);

php phptricks migrate:make UsersTable create -table=users

php phptricks migrate

php phptricks model UserModel --table=users