1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-31 17:51:43 +02:00

bugfix, enhanced error reporting, better examples

This commit is contained in:
David Grudl
2007-05-11 22:25:32 +00:00
parent d03f60c43c
commit f766827219
19 changed files with 123 additions and 230 deletions

View File

@@ -19,14 +19,9 @@ dibi::$logAll = TRUE;
// CHANGE TO REAL PARAMETERS!
dibi::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'root',
'password' => 'xxx',
'database' => 'dibi',
'charset' => 'utf8',
'driver' => 'sqlite',
'database' => 'sample.sdb',
));
@@ -36,13 +31,13 @@ dibi::$throwExceptions = FALSE;
echo '<h1>User-level errors</h1>';
$res = dibi::query('SELECT * FROM [mytable] WHERE [inumber] = %i', 38);
$res = dibi::query('SELECT * FROM [customers] WHERE [customer_id] = %i', 1);
$res = dibi::query('SELECT * FROM [mytable] WHERE [inumber] < %i', 38);
$res = dibi::query('SELECT * FROM [customers] WHERE [customer_id] < %i', 5);
$res = dibi::query('SELECT FROM [mytable] WHERE [inumber] < %i', 38);
$res = dibi::query('SELECT FROM [customers] WHERE [customer_id] < %i', 5);
echo "<br />See file ", dibi::$logFile;
@@ -54,7 +49,7 @@ echo '<h1>DibiException</h1>';
try {
$res = dibi::query('SELECT FROM [mytable] WHERE [inumber] < %i', 38);
$res = dibi::query('SELECT FROM [customers] WHERE [customer_id] < %i', 38);
} catch (DibiException $e) {