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

removed PHP 5.1 support; removed DibiVariable & IDibiVariable

This commit is contained in:
David Grudl
2009-11-16 01:44:10 +01:00
parent 8586eb8e29
commit 75ede18f94
8 changed files with 26 additions and 134 deletions

View File

@@ -1,28 +0,0 @@
<h1>IDibiVariable example</h1>
<?php
require_once 'Nette/Debug.php';
require_once '../dibi/dibi.php';
date_default_timezone_set('Europe/Prague');
// CHANGE TO REAL PARAMETERS!
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'sample.sdb',
'formatDate' => "'Y-m-d'",
'formatDateTime' => "'Y-m-d H-i-s'",
));
// generate and dump SQL
dibi::test("
INSERT INTO [mytable]", array(
'id' => 123,
'date' => dibi::date('12.3.2007'),
'stamp' => dibi::dateTime('23.1.2007 10:23'),
));
// -> INSERT INTO [mytable] ([id], [date], [stamp]) VALUES (123, '2007-03-12', '2007-01-23 10-23-00')

View File

@@ -33,7 +33,7 @@ $array = array(
'title' => 'Super Product',
'price' => 12,
'brand' => NULL,
'created' => dibi::datetime(),
'created' => new DateTime,
);
dibi::test("INSERT INTO [products]", $array, $array, $array);
// -> INSERT INTO [products] ([title], [price], [brand], [created]) VALUES ('Super Product', ...) , (...) , (...)