1
0
mirror of https://github.com/dg/dibi.git synced 2025-02-22 09:53:11 +01:00
php-dibi/examples/table-prefix.php
David Grudl d35a850311 * removed $throwExceptions (always throws)
* added DibiLogger, dibi::notify(), dibi::startLogger()
* miniprofiler dibi::$numOfQueries, $totalTime, $elapsedTime
* simplified DibiException, added DibiDatabaseException
* Dibi::nativeQuery splitted into DibiDriver::doQuery & nativeQuery()
* moved dibi::dumpResult -> DibiResult::dump()
* moved dibi::test() -> DibiDriver::test()
* DibiTranslator generates $mask
2007-09-29 07:53:25 +00:00

27 lines
530 B
PHP

<h1>dibi prefix & substitute example</h1>
<?php
require_once '../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'sample.sdb',
));
// create new substitution :blog: ==> wp_
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'");