1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-29 08:49:50 +02:00

modified SVN properties

This commit is contained in:
David Grudl
2008-07-17 03:51:29 +00:00
parent 7f0fa2e75e
commit c0bd3761de
45 changed files with 8225 additions and 8227 deletions

View File

@@ -1,63 +1,63 @@
<h1>dibi dump example</h1>
<?php
require_once '../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'sample.sdb',
));
$id = 10;
$record = array(
'title' => 'Drtička na trávu',
'price' => 318,
'active' => TRUE,
);
// SELECT ...
dibi::select('product_id')->as('id')
->select('title')
->from('products')
->innerJoin('orders')->using('(product_id)')
->innerJoin('customers USING (customer_id)')
->orderBy('title')
->test();
echo "\n";
// INSERT ...
dibi::insert('products', $record)
->setFlag('IGNORE')
->test();
echo "\n";
// UPDATE ...
dibi::update('products', $record)
->where('product_id = %d', $id)
->test();
echo "\n";
// DELETE ...
dibi::delete('products')
->where('product_id = %d', $id)
->test();
echo "\n";
// custom commands
dibi::command()
->update('products')
->where('product_id = %d', $id)
->set($record)
->test();
echo "\n";
dibi::command()
->truncate('products')
->test();
<h1>dibi dump example</h1>
<?php
require_once '../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'sample.sdb',
));
$id = 10;
$record = array(
'title' => 'Drtička na trávu',
'price' => 318,
'active' => TRUE,
);
// SELECT ...
dibi::select('product_id')->as('id')
->select('title')
->from('products')
->innerJoin('orders')->using('(product_id)')
->innerJoin('customers USING (customer_id)')
->orderBy('title')
->test();
echo "\n";
// INSERT ...
dibi::insert('products', $record)
->setFlag('IGNORE')
->test();
echo "\n";
// UPDATE ...
dibi::update('products', $record)
->where('product_id = %d', $id)
->test();
echo "\n";
// DELETE ...
dibi::delete('products')
->where('product_id = %d', $id)
->test();
echo "\n";
// custom commands
dibi::command()
->update('products')
->where('product_id = %d', $id)
->set($record)
->test();
echo "\n";
dibi::command()
->truncate('products')
->test();