mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 14:16:39 +02:00
* throwing exception in DibiTranslator and DibiDriver
+ added dibi::$errorMode
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
require_once '../dibi/dibi.php';
|
||||
|
||||
// required since PHP 5.1.0
|
||||
if (function_exists('date_default_timezone_set'))
|
||||
date_default_timezone_set('Europe/Prague'); // or 'GMT'
|
||||
|
||||
|
||||
/**
|
||||
@@ -54,7 +57,7 @@ class TDateTime implements IDibiVariable
|
||||
|
||||
// connects to mysqli
|
||||
dibi::connect(array(
|
||||
'driver' => 'mysqli',
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'username' => 'root',
|
||||
'password' => 'xxx', // change to real password!
|
||||
|
@@ -17,6 +17,8 @@ dibi::connect(array(
|
||||
|
||||
|
||||
$res = dibi::query('SELECT * FROM table');
|
||||
if (is_error($res))
|
||||
die('SQL error');
|
||||
|
||||
|
||||
// fetch a single value
|
||||
|
@@ -28,5 +28,6 @@ $res = dibi::query('SELECT * FROM [nucleus_item] WHERE [inumber] < %i', 38);
|
||||
|
||||
$res = dibi::query('SELECT * FROM [*nucleus_item] WHERE [inumber] < %i', 38);
|
||||
|
||||
echo 'See file ', dibi::$logFile;
|
||||
|
||||
?>
|
@@ -7,6 +7,11 @@ pre.dibi { padding-bottom: 10px; }
|
||||
require_once '../dibi/dibi.php';
|
||||
|
||||
|
||||
// required since PHP 5.1.0
|
||||
if (function_exists('date_default_timezone_set'))
|
||||
date_default_timezone_set('Europe/Prague'); // or 'GMT'
|
||||
|
||||
|
||||
// mysql
|
||||
dibi::connect(array(
|
||||
'driver' => 'mysql',
|
||||
|
Reference in New Issue
Block a user