PHP code example of test-lin / db

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

    

test-lin / db example snippets


$config = [
    'db_type' => 'mysqli', // mysqli or pdo
    'mysqli' => [
        'host' => '127.0.0.1',
        'port' => 3306,
        'username' => 'root',
        'password' => 'root',
        'dbname' => 'test'
    ],
    'pdo' => [
        'host' => '127.0.0.1',
        'port' => 3306,
        'username' => 'root',
        'password' => 'root',
        'dbname' => 'test'
    ]
];

$db_type = $config['db_type'];
$db = new Testlin\Db\Db($db_type, $config[$db_type]);