PHP code example of devtoolboxuk / storage

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

    

devtoolboxuk / storage example snippets


use devtoolboxuk/storage;

$dbOptions = [
    'adapter' => 'mysql',
    'driver' => 'mysqli',
    'host' => '',
    'dbname' => '',
    'user' => '',
    'password' => '',
    'port' => '3306',
    'charset' => 'utf8
];
$storage = new StorageManager($dbOptions);
$conn = $storage->getAdapter()->connection();
$queryBuilder = $conn->createQueryBuilder();

$result = $queryBuilder
    ->select('id', 'name')
    ->from('users')
    ->execute();
print_r($result->fetchAll());
sh