PHP code example of atk4 / dsql

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

    

atk4 / dsql example snippets

 php
$query = new Atk4\Dsql\Query();
$query  ->table('employees')
        ->where('birth_date','1961-05-02')
        ->field('count(*)')
        ;
echo "Employees born on May 2, 1961: ".$query->getOne();
 php
$m = new Client($db);
echo $m->addCondition('vip', true)
  ->ref('Order')
  ->ref('Line')
  ->action('fx', ['sum', 'total'])
  ->getDebugQuery();
 php
b = new \Atk4\Data\Persistence_SQL('mysql:dbname=atkui;host=localhost','root','root');

$app = new \Atk4\Ui\App('My First App');
$app->initLayout('Centered');

$g = $layout->add(new \Atk4\Ui\Grid());
$g->setModel(new Employee($db), false);