PHP code example of dabl / query

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

    

dabl / query example snippets


use Dabl\Query\Query;
use Dabl\Adapter\DABLPDO;

$q = Query::create('my_table')
    ->leftJoin('my_table.id', 'other_table.my_table_id')
    ->add('my_column', 'some value')
    ->orGreater('another_column', 5)
    ->groupBy('other_table.id')
    ->orderBy('my_table.name', Query::DESC);

echo "$q";

$pdo = DABLPDO::connect(array(
    'driver' => 'mysql',
    'host' => 'localhost',
    'dbname' => 'test',
    'user' => 'root',
    'password' => ''
));

$q->getQuery($pdo)->bindAndExecute();