Skip to content Skip to sidebar Skip to footer

Mysql Not Updating After Calling Connection.commit() With Flask (working)

I'm using flask to build a simple web app but for whatever reason the conn.commit() is not committing the data into the database. I know this because when I manually add something

Solution 1:

In the fourth line of your code, change it from cursor = mysql.connect().cursor() to cursor = conn.cursor(). This will ensure that the cursor uses the existing connection to database (from the previous line of code), instead of creating a new MySQL connection.


Post a Comment for "Mysql Not Updating After Calling Connection.commit() With Flask (working)"