diff --git a/examples/dumping-sql-and-result-set.php b/examples/dumping-sql-and-result-set.php
index f25f4557..c327dee6 100644
--- a/examples/dumping-sql-and-result-set.php
+++ b/examples/dumping-sql-and-result-set.php
@@ -16,9 +16,9 @@ dibi::connect(array(
$res = dibi::query('
- SELECT * FROM [products]
- INNER JOIN [orders] USING ([product_id])
- INNER JOIN [customers] USING ([customer_id])
+ SELECT * FROM products
+ INNER JOIN orders USING (product_id)
+ INNER JOIN customers USING (customer_id)
');
diff --git a/examples/fetching-examples.php b/examples/fetching-examples.php
index 897436a0..a434b71f 100644
--- a/examples/fetching-examples.php
+++ b/examples/fetching-examples.php
@@ -34,19 +34,19 @@ Debug::dump($row); // Chair
// fetch a single value
echo "
fetchSingle()
\n";
-$value = dibi::fetchSingle('SELECT [title] FROM [products]');
+$value = dibi::fetchSingle('SELECT title FROM products');
Debug::dump($value); // Chair
// fetch complete result set
echo "fetchAll()
\n";
-$all = dibi::fetchAll('SELECT * FROM [products]');
+$all = dibi::fetchAll('SELECT * FROM products');
Debug::dump($all);
// fetch complete result set like association array
echo "fetchAssoc('title')
\n";
-$res = dibi::query('SELECT * FROM [products]');
+$res = dibi::query('SELECT * FROM products');
$assoc = $res->fetchAssoc('title'); // key
Debug::dump($assoc);
@@ -80,9 +80,9 @@ foreach ($res->getIterator(2, 1) as $n => $row) {
// more complex association array
$res = dibi::query('
SELECT *
- FROM [products]
- INNER JOIN [orders] USING ([product_id])
- INNER JOIN [customers] USING ([customer_id])
+ FROM products
+ INNER JOIN orders USING (product_id)
+ INNER JOIN customers USING (customer_id)
');
echo "fetchAssoc('customers.name|products.title')
\n";
diff --git a/examples/nette-debug-and-exceptions.php b/examples/nette-debug-and-exceptions.php
index 7ff794d3..0ca63cd9 100644
--- a/examples/nette-debug-and-exceptions.php
+++ b/examples/nette-debug-and-exceptions.php
@@ -28,4 +28,4 @@ dibi::connect(array(
// throws error because SQL is bad
-dibi::query('SELECT FROM [customers] WHERE [customer_id] < %i', 38);
+dibi::query('SELECT FROM customers WHERE customer_id < %i', 38);
diff --git a/examples/nette-debug-and-variables.php b/examples/nette-debug-and-variables.php
index dabe46c3..40dd18bc 100644
--- a/examples/nette-debug-and-variables.php
+++ b/examples/nette-debug-and-variables.php
@@ -27,4 +27,4 @@ dibi::connect(array(
));
-Debug::barDump( dibi::fetchAll('SELECT * FROM [customers] WHERE [customer_id] < %i', 38), '[customers]' );
+Debug::barDump( dibi::fetchAll('SELECT * FROM customers WHERE customer_id < %i', 38), '[customers]' );
diff --git a/examples/query-language-and-conditions.php b/examples/query-language-and-conditions.php
index 5c0a3412..7992b722 100644
--- a/examples/query-language-and-conditions.php
+++ b/examples/query-language-and-conditions.php
@@ -26,10 +26,10 @@ $name = $cond1 ? 'K%' : NULL;
// if & end
dibi::test('
SELECT *
- FROM [customers]
- %if', isset($name), 'WHERE [name] LIKE %s', $name, '%end'
+ FROM customers
+ %if', isset($name), 'WHERE name LIKE %s', $name, '%end'
);
-// -> SELECT * FROM [customers] WHERE [name] LIKE 'K%'
+// -> SELECT * FROM customers WHERE name LIKE 'K%'
@@ -37,22 +37,22 @@ dibi::test('
// if & else & (optional) end
dibi::test("
SELECT *
- FROM [people]
- WHERE [id] > 0
- %if", ($foo > 0), "AND [foo]=%i", $foo, "
- %else %if", ($bar > 0), "AND [bar]=%i", $bar, "
+ FROM people
+ WHERE id > 0
+ %if", ($foo > 0), "AND foo=%i", $foo, "
+ %else %if", ($bar > 0), "AND bar=%i", $bar, "
");
-// -> SELECT * FROM [people] WHERE [id] > 0 AND [bar]=2
+// -> SELECT * FROM people WHERE id > 0 AND bar=2
// nested condition
dibi::test('
SELECT *
- FROM [customers]
+ FROM customers
WHERE
- %if', isset($name), '[name] LIKE %s', $name, '
- %if', $cond2, 'AND [admin]=1 %end
+ %if', isset($name), 'name LIKE %s', $name, '
+ %if', $cond2, 'AND admin=1 %end
%else 1 LIMIT 10 %end'
);
-// -> SELECT * FROM [customers] WHERE LIMIT 10
+// -> SELECT * FROM customers WHERE LIMIT 10
diff --git a/examples/query-language-basic-examples.php b/examples/query-language-basic-examples.php
index a21a1584..2bb2452e 100644
--- a/examples/query-language-basic-examples.php
+++ b/examples/query-language-basic-examples.php
@@ -32,12 +32,12 @@ dibi::test('
// dibi detects INSERT or REPLACE command
dibi::test('
- REPLACE INTO [products]', array(
+ REPLACE INTO products', array(
'title' => 'Super product',
'price' => 318,
'active' => TRUE,
));
-// -> REPLACE INTO [products] ([title], [price], [active]) VALUES ('Super product', 318, 1)
+// -> REPLACE INTO products ([title], [price], [active]) VALUES ('Super product', 318, 1)
@@ -48,19 +48,19 @@ $array = array(
'brand' => NULL,
'created' => new DateTime,
);
-dibi::test("INSERT INTO [products]", $array, $array, $array);
-// -> INSERT INTO [products] ([title], [price], [brand], [created]) VALUES ('Super Product', ...) , (...) , (...)
+dibi::test("INSERT INTO products", $array, $array, $array);
+// -> INSERT INTO products ([title], [price], [brand], [created]) VALUES ('Super Product', ...) , (...) , (...)
// dibi detects UPDATE command
dibi::test("
- UPDATE [colors] SET", array(
+ UPDATE colors SET", array(
'color' => 'blue',
'order' => 12,
), "
- WHERE [id]=%i", 123);
-// -> UPDATE [colors] SET [color]='blue', [order]=12 WHERE [id]=123
+ WHERE id=%i", 123);
+// -> UPDATE colors SET [color]='blue', [order]=12 WHERE id=123
@@ -68,10 +68,10 @@ dibi::test("
$array = array(1, 2, 3);
dibi::test("
SELECT *
- FROM [people]
- WHERE [id] IN (", $array, ")
-");
-// -> SELECT * FROM [people] WHERE [id] IN ( 1, 2, 3 )
+ FROM people
+ WHERE id IN (%i)", $array
+);
+// -> SELECT * FROM people WHERE id IN ( 1, 2, 3 )
@@ -82,10 +82,10 @@ $order = array(
);
dibi::test("
SELECT *
- FROM [people]
+ FROM people
ORDER BY %by", $order, "
");
-// -> SELECT * FROM [people] ORDER BY [field1] ASC, [field2] DESC
+// -> SELECT * FROM people ORDER BY [field1] ASC, [field2] DESC