Still toying with sql syntax

This commit is contained in:
Brett Kelly 2003-03-28 02:56:05 +00:00
parent 2db2f64696
commit 9808581d37
1 changed files with 7 additions and 6 deletions

View File

@ -106,10 +106,11 @@ class Notes(DBHandler, callbacks.Privmsg):
"set a note as unread"
noteid = privmsgs.getArgs(args)
self.cursor.execute("""UPDATE notes
SET read="False"
SET read='False'
where id = %d""" % int(noteid))
self.db.commit()
irc.reply(msg, conf.replySuccess)
def sendnote(self, irc, msg, args):
"sends a new note to an IRC user"
# sendnote <user> <text>
@ -126,10 +127,10 @@ class Notes(DBHandler, callbacks.Privmsg):
recipID = self.getUserID(recipient)
if ircutils.isChannel(msg.args[0]): public = "True"
else: public = "False"
self.cursor.execute("""INSERT INTO notes
VALUES (%d,%d,%d,'False',%s,%s)""" %\
(int(senderID), int(recipID), int(time.time()),
public, note))
self.cursor.execute("""INSERT INTO notes VALUES
(NULL, %d, %d, %d, %s, %s, %s)""",
int(senderID), int(recipID), time.time(),
'False', public, note)
self.db.commit()
irc.reply(msg, conf.replySuccess)