1
0
mirror of https://github.com/dg/dibi.git synced 2025-07-31 19:30:30 +02:00

update to 0.5alpha

This commit is contained in:
David Grudl
2006-06-04 23:06:33 +00:00
commit 0d18c4c366
21 changed files with 3384 additions and 0 deletions

34
examples/metatypes.php Normal file
View File

@@ -0,0 +1,34 @@
<pre>
<?php
require_once '../dibi/dibi.php';
// mysql
dibi::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'root',
'password' => '***',
'database' => 'test',
'charset' => 'utf8',
));
$res = dibi::query('SELECT * FROM [nucleus_item] WHERE [inumber] <> %i', 38);
$res = dibi::query('SELECT * FROM [nucleus_item] WHERE [inumber] <> %i', 38);
// auto-convert this field to integer
$res->setType('inumber', DibiResult::FIELD_INTEGER);
$record = $res->fetch();
var_dump($record);
// auto-detect all types
$res->setType(TRUE);
$record = $res->fetch();
var_dump($record);
?>