1
0
mirror of https://github.com/dg/dibi.git synced 2025-10-22 10:16:02 +02:00
Files
php-dibi/examples/table-prefix.php
David Grudl da608c2db2 substitutes moved from DibiDriver to Dibi
changed "comments" behavior in DibiParser
2006-09-23 06:34:44 +00:00

32 lines
629 B
PHP

<?php
require_once '../dibi/dibi.php';
// connects to mysqli
dibi::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'root',
'password' => 'xxx', // change to real password!
'charset' => 'utf8',
));
// create new substitution :blog: ==> wp_items_
dibi::addSubst('blog', 'wp_');
// generate and dump SQL
dibi::test("UPDATE [:blog:items] SET [text]='Hello World'");
// create new substitution :: (empty) ==> my_
dibi::addSubst('', 'my_');
// generate and dump SQL
dibi::test("UPDATE [database.::table] SET [text]='Hello World'");
?>