Core/DBLayer: Convert PQuery() queries to prepared statements

This commit is contained in:
leak
2012-03-24 01:25:08 +01:00
parent 8e96b86715
commit 12e55a04bb
37 changed files with 1037 additions and 457 deletions
+5 -2
View File
@@ -2334,7 +2334,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
do
{
Field* fieldsAccount = resultAccounts->Fetch();
uint32 account = fieldsAccount->GetUInt32();
uint32 account = fieldsAccount[0].GetUInt32();
if (mode != BAN_IP)
{
@@ -2770,7 +2770,10 @@ void World::ResetDailyQuests()
void World::LoadDBAllowedSecurityLevel()
{
QueryResult result = LoginDatabase.PQuery("SELECT allowedSecurityLevel from realmlist WHERE id = '%d'", realmID);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL);
stmt->setInt32(0, int32(realmID));
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt16()));
}