[11317] More SQL requests to use prepared statements.

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2011-04-06 00:11:28 +03:00
parent 889ce13264
commit 8fd323a09a
7 changed files with 63 additions and 26 deletions

View file

@ -266,7 +266,12 @@ World::AddSession_ (WorldSession* s)
float popu = float(GetActiveSessionCount()); // updated number of users on the server
popu /= pLimit;
popu *= 2;
LoginDatabase.PExecute ("UPDATE realmlist SET population = '%f' WHERE id = '%u'", popu, realmID);
static SqlStatementID id;
SqlStatement stmt = LoginDatabase.CreateStatement(id, "UPDATE realmlist SET population = ? WHERE id = ?");
stmt.PExecute(popu, realmID);
DETAIL_LOG("Server Population (%f).", popu);
}
}