PHP code example of aka-dmc / clean-pdo

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

    

aka-dmc / clean-pdo example snippets



$db = new db('db_sample_settings.json');

$query = 'select name from users where userID = :id';
$db->addParam(':id',1,PDO::PARAM_INT);
$result = $db->processQuery($query);

$query = 'insert into users (name) values (:username)';
$db->addParam(':username',"David",PDO::PARAM_STR);
$result = $db->processQuery($query);