summaryrefslogtreecommitdiff
path: root/modules/extra/db_mysql_live.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-23 05:01:10 -0400
committerAdam <Adam@anope.org>2011-05-16 04:07:30 -0400
commit6922bd239c778e8f6f2081476ce20b9426c515ad (patch)
treef428e0e5e8bfe638e1be0cdb5ea5b90360dd4d13 /modules/extra/db_mysql_live.cpp
parent13aa58ce5db50083c751648f87df31b3db8dc82f (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.cpp16
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)
{