1
0
mirror of https://github.com/dg/dibi.git synced 2025-02-24 02:43:09 +01:00
php-dibi/examples/dumping-sql-and-result-set.php

33 lines
519 B
PHP
Raw Normal View History

2010-08-03 12:28:07 +02:00
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
2010-08-03 11:48:51 +02:00
<h1>Dumping SQL and Result Set | dibi</h1>
2010-08-03 12:28:07 +02:00
2008-07-17 03:51:29 +00:00
<?php
2015-01-13 16:27:01 +01:00
require __DIR__ . '/../src/loader.php';
2008-07-17 03:51:29 +00:00
2015-10-06 01:39:01 +02:00
dibi::connect([
2015-06-19 03:11:36 +02:00
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
2015-10-06 01:39:01 +02:00
]);
2008-07-17 03:51:29 +00:00
$res = dibi::query('
SELECT * FROM products
INNER JOIN orders USING (product_id)
INNER JOIN customers USING (customer_id)
2008-07-17 03:51:29 +00:00
');
echo '<h2>dibi::dump()</h2>';
// dump last query (dibi::$sql)
dibi::dump();
// dump result table
echo '<h2>Dibi\Result::dump()</h2>';
2008-07-17 03:51:29 +00:00
$res->dump();