PHP code example of nkt / silex-pdo-provider

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

    

nkt / silex-pdo-provider example snippets


$app->register(new \Silex\Provider\PDOServiceProvider, array(
  'pdo.dsn'        => 'mysql:host=localhost;dbname=foobar', // sqlite::memory: by default
  'pdo.username'   => 'nkt', // null by default
  'pdo.password'   => 'hello world', // null by default
  'pdo.attributes' => array(), // empty array by default
  'pdo.class_name' => 'MyCustomPDOClass' // PDO by default
));