PHP code example of pfinal / database

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

    

pfinal / database example snippets




    ig = array(
        'dsn' => 'mysql:host=localhost;dbname=test',
        'username' => 'root',
        'password' => '',
        'charset' => 'utf8',
        'tablePrefix' => 'db_',
    );
    
    $db = new \PFinal\Database\Builder($config);
    
    $id = $db->table('user')->insertGetId(['username' => 'Jack', 'email' => '[email protected]']);
    
    echo $id;
    
  



    loader = new \PFinal\Database\ClassLoader();
    $loader->register();