示例#1
0
<?php

include 'database.php';
$query = new \DBAL\SQL\Query();
$query->build()->select('*')->from($database->Models['Control']);
$results = $query($database);
foreach ($results as $item) {
    var_dump($item);
}
示例#2
0
<?php

$query = new \DBAL\SQL\Query();
$query->build()->insert('table')->set('field', 'value')->set('field2', 2);
echo (string) $query;
示例#3
0
<?php

include 'database.php';
$query = new \DBAL\SQL\Query();
$query->build()->models();
$tables = $query($database);
foreach ($tables as $table) {
    var_dump($table);
}
示例#4
0
<?php

$driver = new \DBAL\Driver\MySQL();
$connection = new \DBAL\Connection($driver);
$query = new \DBAL\SQL\Query();
$query->Text = "SELECT * FROM table";
$results = $query->execute();
echo $query->Text;
示例#5
0
<?php

include 'database.php';
$query = new \DBAL\SQL\Query();
$query->build()->tables();
$tables = $query($database);
foreach ($tables as $table) {
    var_dump($table);
    $query = new \DBAL\SQL\Query();
    $query->build()->columns()->from($table);
    $columns = $query($database);
    var_dump($columns);
}