mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[11317] More SQL requests to use prepared statements.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
889ce13264
commit
8fd323a09a
7 changed files with 63 additions and 26 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue