PHP code example of webimage / app-db

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

    

webimage / app-db example snippets


[
    'database' => [
        'connections' => [
            'default|connectionName' => [ // Doctrine connection manager compatible
                'dbname'   => 'your_database_name',
                'user'     => 'your_username',
                'password' => 'your_password',
                'host'     => '127.0.0.1', // Optional
                'port'     => 3306, // Optional
                'driver'   => 'pdo_mysql'
            ]
        ]
    ]
)

[
    'database' => [
        'globalTablePrefix' => 'prefix_'
    ]
]

[
    'database' => [
        'tables' => [
            'tableAlias' => 'tableName'
        ]
    ]
]

[
    'database' => [
        'tables' => [
            'tableAlias' => [
                'table' => 'tableName',
                'readConnection' => 'readConnectionName',
                'writeConnection' => 'writeConnectionName',
                'useGlobalPrefix' => true|false
            ] 
        ]
    ]
]