diff options
| author | Adam <Adam@anope.org> | 2011-04-23 05:01:10 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-05-16 04:07:30 -0400 |
| commit | 6922bd239c778e8f6f2081476ce20b9426c515ad (patch) | |
| tree | f428e0e5e8bfe638e1be0cdb5ea5b90360dd4d13 /modules/extra/db_mysql_live.cpp | |
| parent | 13aa58ce5db50083c751648f87df31b3db8dc82f (diff) | |
Fixed up the MySQL Query code and finished some command code I forgot earlier
Diffstat (limited to 'modules/extra/db_mysql_live.cpp')
| -rw-r--r-- | modules/extra/db_mysql_live.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/extra/db_mysql_live.cpp b/modules/extra/db_mysql_live.cpp index 1b688f439..8faa11a1f 100644 --- a/modules/extra/db_mysql_live.cpp +++ b/modules/extra/db_mysql_live.cpp @@ -141,7 +141,7 @@ class MySQLLiveModule : public Module SQLCache chan_cache, nick_cache, core_cache; - SQLResult RunQuery(const Anope::string &query) + SQLResult RunQuery(const SQLQuery &query) { if (!this->SQL) throw SQLException("Unable to locate SQL reference, is m_mysql loaded and configured correctly?"); @@ -152,11 +152,6 @@ class MySQLLiveModule : public Module return res; } - const Anope::string Escape(const Anope::string &query) - { - return SQL ? SQL->Escape(query) : query; - } - CommandMutex *CurrentCommand() { if (this->ACS) @@ -186,7 +181,8 @@ class MySQLLiveModule : public Module try { - Anope::string query = "SELECT * FROM `anope_cs_info` WHERE `name` = '" + this->Escape(chname) + "'"; + SQLQuery query("SELECT * FROM `anope_cs_info` WHERE `name` = ?"); + query.setValue(1, chname); CommandMutex *current_command = this->CurrentCommand(); if (current_command) { @@ -222,7 +218,8 @@ class MySQLLiveModule : public Module try { - Anope::string query = "SELECT * FROM `anope_ns_alias` WHERE `nick` = '" + this->Escape(nick) + "'"; + SQLQuery query("SELECT * FROM `anope_ns_alias` WHERE `nick` = ?"); + query.setValue(1, nick); CommandMutex *current_command = this->CurrentCommand(); if (current_command) { @@ -258,7 +255,8 @@ class MySQLLiveModule : public Module try { - Anope::string query = "SELECT * FROM `anope_ns_core` WHERE `display` = '" + this->Escape(nick) + "'"; + SQLQuery query("SELECT * FROM `anope_ns_core` WHERE `display` = ?"); + query.setValue(1, nick); CommandMutex *current_command = this->CurrentCommand(); if (current_command) { |
