PHP code example of simbiat / database

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

    

simbiat / database example snippets


$config = (new \Simbiat\Database\Config)->setUser('user')->setPassword('password')->setDB('database');

$config->setOption(\PDO::MYSQL_ATTR_FOUND_ROWS, true)->setOption(\PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @@global.character_set_client = \'utf8mb4\', @@global.character_set_connection = \'utf8mb4\', @@global.character_set_database = \'utf8mb4\', @@global.character_set_results = \'utf8mb4\', @@global.character_set_server = \'utf8mb4\', @@global.time_zone=\'+00:00\'');

(new \Simbiat\Database\Pool)->openConnection($config, 'example');

(new \Simbiat\Database\Pool)->openConnection();

\Simbiat\Database\Pool::$errors

(new \Simbiat\Database\Controller)->count('SELECT COUNT(*) FROM `table`');

(new \Simbiat\Database\Controller)->check('SELECT * FROM `table` WHERE `time`=:value', [':value'=>['', 'time']]);