-2
Ich erhalte die Fehlerinformationen nach dieser Codezeile ausgeführtpython mysql einfügen Fehler
query = ("INSERT INTO Movies" "(movie_id,movie_name,movie_year,duration,score,storyline,genre,poster)"
"VALUES (%(ID)s,%(name)s,%(year)s,%(runtime)s,%(rating)s,%(storyline)s,%(genre)s,%(links)s)") #args = (ID,name,year,runtime,rating,storyline,genre,links)
cursor.execute(query)
con.commit()
Das Format ist von mysql document
die Fehlermeldung
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%(ID)s,%(name)s,%(year)s,%(runtime)s,%(rating)s,%(storyline)s,%(genre)s,%(links)' at line 1
Sie übergeben die Argumente nicht an die Funktion 'execute'. – Transcendental