I have an app route in a Flask web application, which under the "POST" method, takes data from a website form and is supposed to add an entry into a SQLite database (database.db) with that info in the table 'times'. The code runs without invoking any errors, but the database does not update with the added entry. The Flask app properly retrieves the info from the form. This is my code for connecting to the database and attempting to update it. Am I doing anything wrong?
connection=sqlite3.connect("database.db")
cursor=connection.cursor()
cursor.execute("INSERT INTO times (firstname, lastname, year, gender, event, minutes, seconds, milliseconds, date) VALUES(:first, :last, :year, :gender, :event, :minutes, :seconds, :milliseconds, :date)",
dict(first=first, last=last, year=year, gender=gender, event=event, minutes=minutes, seconds=seconds, milliseconds=milliseconds, date=date))
return redirect("/")