Reputation: 75
I'm trying to write to a database as follows, but I get this error:
1210: Incorrect number of arguments executing prepared statement
Execute statement:
query = "INSERT INTO db.tbl1(name, msg) VALUES (%s,%s)"
cursor.executemany(query, ([message.author.name], [message.content]))
mydb.commit()
Sorry im new to this. Any idea why?
Upvotes: 0
Views: 482
Reputation: 953
you are doing it wrong try this :
cursor.executemany(query, [(message.author.name, message.content)])
Upvotes: 1