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

added DibiDriver::disconnect()

This commit is contained in:
David Grudl
2007-11-10 07:37:44 +00:00
parent 8a6d664876
commit 9ff43d0ac3
15 changed files with 304 additions and 129 deletions

View File

@@ -0,0 +1,27 @@
<h1>dibi extension method example</h1>
<pre>
<?php
require_once '../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'sample.sdb',
));
// using the "prototype" to add custom method to class DibiResult
function DibiResult_prototype_fetchShuffle(DibiResult $obj)
{
$all = $obj->fetchAll();
shuffle($all);
return $all;
}
// fetch complete result set shuffled
$res = dibi::query('SELECT * FROM [customers]');
$all = $res->fetchShuffle();
print_r($all);