PHP code example of veasin / nx-db-pdo

1. Go to this page and download the library: Download veasin/nx-db-pdo 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/ */

    

veasin / nx-db-pdo example snippets


'db/pdo'=>[
    'default' => [
        'dsn' => 'mysql:dbname=db_name;host=host_url;charset=utf8mb4',
        'username' => 'db_user',
        'password' => 'db_password',
        'options' => [
        ],
    ],
]

class app extends nx\app{
    use \nx\parts\db\pdo;
} 

$this->db()->execute("SELECT * FROM `user`");
$this->table("user")->select()->execute();
//$this->db()->table("user");