1
0
mirror of https://github.com/dg/dibi.git synced 2025-01-17 22:28:50 +01:00
php-dibi/examples/metatypes.php
2008-05-12 00:30:59 +00:00

22 lines
420 B
PHP

<h1>dibi metatypes example</h1>
<pre>
<?php
require_once '../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'sample.sdb',
));
$res = dibi::query('SELECT * FROM [customers]');
// auto-convert this column to integer
$res->setType('customer_id', Dibi::FIELD_INTEGER);
$res->setType('added', Dibi::FIELD_DATETIME, 'H:i j.n.Y');
$row = $res->fetch();
var_dump($row);