From 5a1641a9ce86e41dd43beeb84efe2934144cd390 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Fri, 15 Jul 2016 10:10:35 -0500 Subject: [PATCH] Fixed syntax error --- cogs/mod.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/mod.py b/cogs/mod.py index 0990d10..61ab54b 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -102,12 +102,12 @@ class Mod: .format(permissions, "\n".join(valid_perms))) else: cursor = config.getCursor() - cursor.execute('use {}'.format(config.db_default)) - cursor.execute("show tables like '{}'".format(ctx.message.server.id)) + cursor.execute('use %s', (config.db_default,)) + cursor.execute("show tables like %s", (ctx.message.server.id,)) result = cursor.fetchone() if result is None: #Server's data doesn't exist yet, need to create it - sql = "create table `%s` (`server_id` varchar(255) not null,`command` varchar(32) not null," + sql = "create table %s (`server_id` varchar(255) not null,`command` varchar(32) not null," "`perms` varchar(32) not null,primary key (`server_id`)) engine=InnoDB default charset=utf8 collate=utf8_bin" cursor.execute(sql, (ctx.message.server.id,)) cursor.execute("insert into %s (server_id, command, perms) values(%s, %s, %s)",(ctx.message.server.id,ctx.message.server.id,command,perms))