0

私はこれを多くの方法で試しましたが、理解できないようですが、とにかくここに私がしていることがあります:

threadupdatequery = "UPDATE %s SET topic_name=%%s, subject_name=%%s, poster_name=%%s, time=%%s, image=%%s, replies=%%s, id=%%s, keywords=%%s, text=%%s WHERE id=%%s" % ('Threads')
...
(topic, subject, name, time, image, replies, ID, kw, body) = self.tframe.Get()
cur.execute(threadupdatequery, (topic, subject, name, time, image, replies, ID, kw, body))

もともと私はこれをやったが、間違いなくうまくいくだろうと思っていたが、私は間違っていた:

cur.execute(threadupdatequery, self.tframe.Get())

私は得続けます:

File "C:\Python27\Work\SiteEditor.py", line 216, in UpdateThread
cur.execute(threadupdatequery, (topic, subject, name, time, image, replies, ID, kw, body))
File "C:\Python27-32Bit\lib\site-packages\MySQLdb\cursors.py", line 184, in execute
query = query % db.literal(args)
TypeError: not enough arguments for format string

私は正確に何を間違っていますか?いつもはばかげた間違いをしますが、今回は見当たりません...

ありがとう :)

4

1 に答える 1