本文整理汇总了PHP中DatabaseManager::get方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseManager::get方法的具体用法?PHP DatabaseManager::get怎么用?PHP DatabaseManager::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_chardb_records
function delete_chardb_records()
{
if (empty($this->data['id'])) {
return false;
}
$id = $this->data['id'];
$queries = array("DELETE FROM `account_data` WHERE `id`= {$id};", "DELETE FROM `account_instance_times` WHERE `id`= {$id};", "DELETE FROM `account_tutorial` WHERE `id`= {$id};");
DatabaseManager::get('char')->queue->add_range($queries);
return true;
}
示例2: delete
function delete()
{
if (empty($this->data['guid'])) {
return false;
}
$queries = array();
$charGUID = $this->data['guid'];
$queries[] = "DELETE FROM `arena_team_member` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `auctionhouse` WHERE `auctioneerguid`= {$charGUID};";
$queries[] = "DELETE FROM `character_account_data` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_achievement` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_achievement_progress` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_action` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_arena_stats` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_aura` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_banned` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_battleground_data` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_battleground_random` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_equipmentsets` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_gifts` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_glyphs` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_homebind` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_instance` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_inventory` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_questatus` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_questatus_daily` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_questatus_rewarded` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_questatus_weekly` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_reputation` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_skills` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_social` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_spell` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_spell_cooldown` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_stats` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `character_talent` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `characters` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `corpse` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `gm_tickets` WHERE `guid`= {$charGUID};";
$queries[] = "DELETE FROM `group_member` WHERE `memberGuid`= {$charGUID};";
$queries[] = "DELETE FROM `groups` WHERE `leaderGuid`= {$charGUID};";
$queries[] = "DELETE FROM `item_instance` WHERE `owner_guid`= {$charGUID};";
$queries[] = "DELETE FROM `item_refund_instance` WHERE `player_guid`= {$charGUID};";
$queries[] = "DELETE FROM `mail` WHERE `receiver`= {$charGUID};";
$queries[] = "DELETE FROM `mail_items` WHERE `receiver`= {$charGUID};";
$queries[] = "DELETE FROM `petition` WHERE `ownerguid`= {$charGUID};";
$queries[] = "DELETE FROM `petition_sign` WHERE `ownerguid`= {$charGUID};";
$queries[] = "DELETE FROM `rg_characters_data` WHERE `guid`= {$charGUID};";
$db = DatabaseManager::get('char')->queue->add_range($queries);
return $this->delete_pets();
}
示例3: array
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
require 'autoloader.php';
Autoloader::register();
Config::load(array('dbconfig' => array('char' => array('user' => 'root', 'pass' => '', 'dsn' => 'mysql:host=127.0.0.1;dbname=characters'), 'auth' => array('user' => 'root', 'pass' => '', 'dsn' => 'mysql:host=127.0.0.1;dbname=auth'))));
$accounts = Account::select('id = 1');
foreach ($accounts as $account) {
$account->delete();
}
DatabaseManager::get('auth')->queue->execute();
DatabaseManager::get('char')->queue->execute();
?>
</body>
</html>