Issue inserting Date(Date formate) into mariadb using Python
I have made this code to write a kind of Log into a database table: _________________________________________________ SQL table head: MariaDB [genre]> show columns from history; +--------------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+---------+------+-----+---------+----------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | | Genre_ID_1 | int(11) | NO | | NULL | | | Genre_ID_2 | int(11) | NO | | NULL | | | Edition_Date | date | YES | | NULL | | +--------------+---------+------+-----+---------+----------------+ 4 rows in set (0.027 sec) __________________________________________________ python code: cursor.execute("INSERT INTO genre.history(Genre_ID_1, Genre_ID_2, Edition_Date) VALUES (?, ?, ?))", (int(input("ID 1:")), int(input("ID 2:"))), date.today()) __________________________________________________ I have tried differrent ways, using '?' and '%b' instead of '%s' and also inderting the Date as date formate or as string but whatever I do I'm getting this Error: Traceback (most recent call last): File "D:\Random Prog\test.py", line 29, in <module> cursor.execute("INSERT INTO genre.history(Genre_ID_1, Genre_ID_2, Edition_Date) VALUES (?, ?, %s))", TypeError: an integer is required (got type str) when using '%s' and 'date.today()' or another like that TypeError: an integer is required (got type str) when using '%b' and 'date.today() Can you please help me?