updated maildb state

This commit is contained in:
Paul 2024-01-13 13:26:48 +01:00
parent b463307259
commit a9d5a8762d

View File

@ -50,7 +50,8 @@ def CreateDB(conn, cursor):
def InsertMail(conn, cursor, sender, recipient, content):
try:
cursor.execute(f"INSERT INTO mail (sender, recipient, content) values ('{sender}','{recipient}','{content}');")
cursor.execute("PREPARE InsertMail as INSERT INTO mail (sender, recipient, content) values ($1, $2, $3);")
cursor.execute("EXECUTE InsertMail (%s, %s, %s);", (sender, recipient, content))
conn.commit()
except Exception as e:
print(e)