mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
- added fluent SQL builders support in DibiConnection and DibiTable
This commit is contained in:
@@ -87,3 +87,7 @@ var_dump($id); // generated id
|
||||
$key = '3 OR 1=1';
|
||||
$products->delete($key);
|
||||
// --> DELETE FROM [products] WHERE [product_id] IN ( 3 )
|
||||
|
||||
|
||||
// select all using fluent interface
|
||||
var_dump($products->select('*')->orderBy('title')->fetchAll());
|
||||
|
@@ -28,6 +28,13 @@ dibi::select('product_id')->as('id')
|
||||
|
||||
echo "\n";
|
||||
|
||||
// SELECT ...
|
||||
echo dibi::select('title')->as('id')
|
||||
->from('products')
|
||||
->fetchSingle();
|
||||
|
||||
echo "\n";
|
||||
|
||||
// INSERT ...
|
||||
dibi::insert('products', $record)
|
||||
->setFlag('IGNORE')
|
||||
|
Reference in New Issue
Block a user