PHP code example of jarjak / dbal-manager

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

    

jarjak / dbal-manager example snippets


//Application.php

$app['dbal_manager'] = $app->share(function ($app) {
    $manager = new JarJak\DBALManager($app['db']);
    return $manager;
});

$sqlArray = [
	'id' => 1,
	'username' => 'JohnKennedy',
	'email' => '[email protected]'
];

/* @var $manager JarJak\DBALManager */
$manager->insertOrUpdate('user', $sqlArray);

$manager->insertIgnore('user', $sqlArray);

$sqlArray = [
    'username' => 'JohnKennedy',
    'email' => '[email protected]',
    'password' => $password,
    'address' => '',
    'active' => 0,
];

/* @var $manager JarJak\DBALManager */
$manager->insertOrUpdate('user', $sqlArray, 2, ['active']);

/* @var QueryBuilder $queryBuilder */
\JarJak\SqlDumper::dumpQuery($queryBuilder);

\JarJak\SqlDumper::dumpSql($sql, $params);