本文整理汇总了PHP中DBConnector::resetTables方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnector::resetTables方法的具体用法?PHP DBConnector::resetTables怎么用?PHP DBConnector::resetTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnector
的用法示例。
在下文中一共展示了DBConnector::resetTables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dbModifiedCallback
print 'CONFIG_PIN = ' . CONFIG_PIN . "\n";
print 'CONFIG_POLICY = ' . CONFIG_POLICY . "\n";
if (defined('CONFIG_SSH')) {
print 'CONFIG_SSH = ' . CONFIG_SSH . "\n";
}
print 'CONFIG_START_URL = ' . CONFIG_START_URL . "\n";
print 'CONFIG_STATIONNAME = ' . CONFIG_STATIONNAME . "\n";
print 'CONFIG_THEME = ' . CONFIG_THEME . "\n";
print 'CONFIG_UPLOAD_DIR = ' . CONFIG_UPLOAD_DIR . "\n";
function dbModifiedCallback()
{
echo "Triggered callback\n";
}
//~ var_dump($_SERVER);
$db = new DBConnector('palma-test.db');
$db->resetTables();
//~ http://stackoverflow.com/questions/1964233/does-sqlite3-support-a-trigger-to-automatically-update-an-updated-on-datetime
//~ https://www.sqlite.org/lang_createtrigger.html
// TODO: Test database triggers (can be used in db.php).
//~ $db->createFunction('dbModifiedCallback', 'dbModifiedCallback', 0);
// {AFTER | BEFORE} {DELETE | INSERT | UPDATE } ON table
//~ $db->exec("CREATE TRIGGER dbchange AFTER UPDATE ON user
//~ BEGIN
//~ dbModifiedCallback();
//~ END");
//~ $db = new DBConnector('palma.db');
echo "Tables=" . $db->querySingle('SELECT count(*) FROM sqlite_master WHERE type="table"') . "\n";
var_dump($db->query("SELECT * from sqlite_master"));
$address = $db->ipAddress();
$db->addUser('testuser1', $address);
//~ $db->addUser('testuser2', $address);