summaryrefslogtreecommitdiffstats
path: root/src/server/database.cpp
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2020-12-05 18:12:04 +0000
committerJoursoir <chat@joursoir.net>2020-12-05 18:12:04 +0000
commit91d777da4f5baeac47b3097913b2407b45bc031e (patch)
tree26c1edbbdb0b6998bb533a5862151f56e1fda025 /src/server/database.cpp
parent6f43ecd3758f445249db2bd4c4b32b912243cbdd (diff)
downloadwant-chat-91d777da4f5baeac47b3097913b2407b45bc031e.tar.gz
want-chat-91d777da4f5baeac47b3097913b2407b45bc031e.tar.bz2
want-chat-91d777da4f5baeac47b3097913b2407b45bc031e.zip
add registration and authorization
Diffstat (limited to 'src/server/database.cpp')
-rw-r--r--src/server/database.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/database.cpp b/src/server/database.cpp
index 4438cc2..dcec5a6 100644
--- a/src/server/database.cpp
+++ b/src/server/database.cpp
@@ -16,6 +16,9 @@ char *DB_ROW::operator[](const int index)
AnswerDB::~AnswerDB()
{
+ if(current_row)
+ delete current_row;
+
mysql_free_result(result);
}
@@ -68,4 +71,9 @@ AnswerDB *DatabaseManager::QuerySelect(const char *sql)
unsigned int fields = mysql_num_fields(result);
unsigned long rows = mysql_num_rows(result);
return new AnswerDB(result, fields, rows);
+}
+
+int DatabaseManager::QueryInsert(const char *sql)
+{
+ return mysql_query(connection, sql);
} \ No newline at end of file