mirror of
https://github.com/dg/dibi.git
synced 2025-09-02 02:22:33 +02:00
modified SVN properties
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
<h1>dibi apply limit/offset example</h1>
|
||||
<pre>
|
||||
<?php
|
||||
|
||||
require_once '../dibi/dibi.php';
|
||||
|
||||
|
||||
dibi::connect(array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => 'sample.sdb',
|
||||
));
|
||||
|
||||
|
||||
// no limit
|
||||
$res = dibi::query('SELECT * FROM [products]');
|
||||
foreach ($res as $n => $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
echo '<hr>';
|
||||
|
||||
// with limit = 2
|
||||
$res = dibi::query('SELECT * FROM [products] %lmt', 2);
|
||||
foreach ($res as $n => $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
echo '<hr>';
|
||||
|
||||
// with limit = 2, offset = 1
|
||||
$res = dibi::query('SELECT * FROM [products] %lmt %ofs', 2, 1);
|
||||
foreach ($res as $n => $row) {
|
||||
print_r($row);
|
||||
}
|
||||
<h1>dibi apply limit/offset example</h1>
|
||||
<pre>
|
||||
<?php
|
||||
|
||||
require_once '../dibi/dibi.php';
|
||||
|
||||
|
||||
dibi::connect(array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => 'sample.sdb',
|
||||
));
|
||||
|
||||
|
||||
// no limit
|
||||
$res = dibi::query('SELECT * FROM [products]');
|
||||
foreach ($res as $n => $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
echo '<hr>';
|
||||
|
||||
// with limit = 2
|
||||
$res = dibi::query('SELECT * FROM [products] %lmt', 2);
|
||||
foreach ($res as $n => $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
||||
echo '<hr>';
|
||||
|
||||
// with limit = 2, offset = 1
|
||||
$res = dibi::query('SELECT * FROM [products] %lmt %ofs', 2, 1);
|
||||
foreach ($res as $n => $row) {
|
||||
print_r($row);
|
||||
}
|
||||
|
Reference in New Issue
Block a user