1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 10:36:38 +02:00

Improve on db_sql_live_read

This commit is contained in:
Adam
2012-01-15 01:47:31 -05:00
parent f38faedbda
commit 964d63cdac
6 changed files with 105 additions and 127 deletions
+8 -2
View File
@@ -85,9 +85,15 @@ class DBMySQL : public Module
void Delete(const Anope::string &table, const Serializable::serialized_data &data)
{
Anope::string query_text = "DELETE FROM `" + table + "` WHERE ";
Anope::string query_text = "DELETE FROM `" + table + "` WHERE ", arg_text;
for (Serializable::serialized_data::const_iterator it = data.begin(), it_end = data.end(); it != it_end; ++it)
query_text += "`" + it->first + "` = @" + it->first + "@";
{
if (!arg_text.empty())
arg_text += " AND ";
arg_text += "`" + it->first + "` = @" + it->first + "@";
}
query_text += arg_text;
SQLQuery query(query_text);
for (Serializable::serialized_data::const_iterator it = data.begin(), it_end = data.end(); it != it_end; ++it)