本文整理匯總了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);