mirror of
https://github.com/dg/dibi.git
synced 2025-08-03 20:57:36 +02:00
examples: files renamed
This commit is contained in:
31
examples/using-limit-and-offset.php
Normal file
31
examples/using-limit-and-offset.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
|
||||
|
||||
<h1>Using Limit & Offset | dibi</h1>
|
||||
|
||||
<?php
|
||||
|
||||
require_once 'Nette/Debug.php';
|
||||
require_once '../dibi/dibi.php';
|
||||
|
||||
|
||||
dibi::connect(array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => 'data/sample.sdb',
|
||||
));
|
||||
|
||||
|
||||
// no limit
|
||||
dibi::test('SELECT * FROM [products]');
|
||||
// -> SELECT * FROM [products]
|
||||
|
||||
|
||||
|
||||
// with limit = 2
|
||||
dibi::test('SELECT * FROM [products] %lmt', 2);
|
||||
// -> SELECT * FROM [products] LIMIT 2
|
||||
|
||||
|
||||
|
||||
// with limit = 2, offset = 1
|
||||
dibi::test('SELECT * FROM [products] %lmt %ofs', 2, 1);
|
||||
// -> SELECT * FROM [products] LIMIT 2 OFFSET 1
|
Reference in New Issue
Block a user