diff --git a/examples/apply-limit.php b/examples/apply-limit.php index f7e61b54..01a56142 100644 --- a/examples/apply-limit.php +++ b/examples/apply-limit.php @@ -1,5 +1,7 @@ + +
+ SELECT * FROM [products] -echo '
'; // with limit = 2 dibi::test('SELECT * FROM [products] %lmt', 2); // -> SELECT * FROM [products] LIMIT 2 -echo '
'; // with limit = 2, offset = 1 dibi::test('SELECT * FROM [products] %lmt %ofs', 2, 1); diff --git a/examples/connect.php b/examples/connect.php index 4f57e185..8bfedb5b 100644 --- a/examples/connect.php +++ b/examples/connect.php @@ -1,4 +1,7 @@ + +dibi::connect() example
+ +dibi dump example
+ +dibi extension method example
-+ +dibi fetch example
-+ '; // fetch a single value $value = dibi::fetchSingle('SELECT [title] FROM [products]'); Debug::dump($value); // Chair -echo '
'; // fetch complete result set $all = dibi::fetchAll('SELECT * FROM [products]'); Debug::dump($all); -echo '
'; // fetch complete result set like association array $res = dibi::query('SELECT * FROM [products]'); $assoc = $res->fetchAssoc('title'); // key Debug::dump($assoc); -echo '
'; // fetch complete result set like pairs key => value $pairs = $res->fetchPairs('product_id', 'title'); Debug::dump($pairs); -echo '
'; // fetch row by row foreach ($res as $n => $row) { Debug::dump($row); } -echo '
'; // fetch row by row with defined offset @@ -83,12 +79,9 @@ INNER JOIN [customers] USING ([customer_id]) $assoc = $res->fetchAssoc('customers.name|products.title'); // key Debug::dump($assoc); -echo '
'; $assoc = $res->fetchAssoc('customers.name[]products.title'); // key Debug::dump($assoc); -echo '
'; $assoc = $res->fetchAssoc('customers.name->products.title'); // key Debug::dump($assoc); -echo '
'; diff --git a/examples/fluent.test.php b/examples/fluent.test.php index bce775cd..9b87bf3e 100644 --- a/examples/fluent.test.php +++ b/examples/fluent.test.php @@ -1,4 +1,7 @@ + +dibi fluent example
+ +dibi import SQL dump example
-+ +dibi logger example
+ +dibi metatypes example
-+ +Nette\Debug & dibi example
-Dibi can display and log exceptions via Nette\Debug, part of Nette Framework.
Dibi can dump variables via Nette\Debug, part of Nette Framework.
Last query:
Number of queries:
diff --git a/examples/sql-builder.php b/examples/sql-builder.php index 5aac0327..dc483c2c 100644 --- a/examples/sql-builder.php +++ b/examples/sql-builder.php @@ -1,8 +1,7 @@ - + ++ -pre.dibi { padding-bottom: 10px; } - + +dibi conditional SQL example
-+ +dibi prefix & substitute example
+ +dibi transaction example
-+