From b2a70f29fe19d9671b1376c3329f0b4193ec80d0 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 10 Jun 2004 13:34:06 +0000 Subject: [PATCH] Fixed bug reported by locsmif on #supybot. --- plugins/FunDB.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/FunDB.py b/plugins/FunDB.py index 3bcfd7d96..16f985e32 100755 --- a/plugins/FunDB.py +++ b/plugins/FunDB.py @@ -152,7 +152,8 @@ class FunDB(callbacks.Privmsg, plugins.ChannelDBHandler): sql = """INSERT INTO %ss VALUES (NULL, %%s, %%s)""" % table cursor.execute(sql, s, name) db.commit() - sql = """SELECT id FROM %ss WHERE %s=%%s""" % (table, table) + sql = """SELECT id FROM %ss WHERE %s=%%s + ORDER BY id DESC LIMIT 1""" % (table, table) cursor.execute(sql, s) id = cursor.fetchone()[0] irc.replySuccess('(%s #%s added)' % (table, id))