1
0
mirror of https://github.com/dg/dibi.git synced 2025-07-10 17:16:25 +02:00
Files
php-dibi/examples/dumping-sql-and-result-set.php
2015-06-19 15:00:23 +02:00

33 lines
522 B
PHP

<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
<h1>Dumping SQL and Result Set | dibi</h1>
<?php
require __DIR__ . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));
$res = dibi::query('
SELECT * FROM products
INNER JOIN orders USING (product_id)
INNER JOIN customers USING (customer_id)
');
echo '<h2>dibi::dump()</h2>';
// dump last query (dibi::$sql)
dibi::dump();
// dump result table
echo '<h2>DibiResult::dump()</h2>';
$res->dump();