mirror of
https://github.com/dg/dibi.git
synced 2025-01-17 22:28:50 +01:00
22 lines
420 B
PHP
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);
|