PHP code example of stefano / stefano-db

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

    

stefano / stefano-db example snippets


return array(
    //single DB connection
    'db' => array(
        'driver' => '',
        'database' => '',
        'username' => '',
        'password' => '',
        'sqls' => array(
            "SET time_zone='+0:00'",
            "....."
        ),
    ),
    'service_manager' => array(
        'factories' => array(
            'Zend\Db\Adapter\Adapter'
                => '\StefanoDb\Adapter\Service\AdapterServiceFactory',
        ),
    ),
);

return array(
    'db' => array(
        'adapters' => array(
            'Db/Write' => array(
                'driver' => '',
                'database' => '',
                'username' => '',
                'password' => '',
                'sqls' => array(
                    "SET time_zone='+0:00'",
                    "....."
                ),
            ),
            'Db/Read' => array(
                'driver' => '',
                'database' => '',
                'username' => '',
                'password' => '',
                'sqls' => array(
                    "SET time_zone='+0:00'",
                    "....."
                ),
            ),
        ),
    ),
    'service_manager' => array(
        'abstract_factories' => array(
            '\StefanoDb\Adapter\Service\AdapterAbstractServiceFactory',
        ),
    ),
);