1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 21:28:02 +02:00

* modified DibiException (getDbError, ...)

* fix dibi::dumpResult()
This commit is contained in:
David Grudl
2007-02-02 03:51:43 +00:00
parent a2b1036a66
commit 0c86515076
16 changed files with 218 additions and 138 deletions

View File

@@ -7,12 +7,13 @@ pre.dibi { padding-bottom: 10px; }
require_once '../dibi/dibi.php';
// mysql
// CHANGE TO REAL PARAMETERS!
dibi::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'root',
'password' => 'xxx', // change to real password!
'password' => 'xxx',
'database' => 'dibi',
'charset' => 'utf8',
));
@@ -26,7 +27,7 @@ $user = $cond1 ? 'Davidek' : NULL;
dibi::test('
SELECT *
FROM [table]
FROM [mytable]
%if', isset($user), 'WHERE [user]=%s', $user, '%end'
);
@@ -41,11 +42,11 @@ FROM %if', $cond1, '[one_table] %else [second_table]'
// nested condition
dibi::test('
SELECT *
FROM [test]
FROM [mytable]
WHERE
%if', isset($user), '[user]=%s', $user, '
%if', $cond2, 'AND [admin]=1 %end
%else LIMIT 10 %end'
);
?>