0
query="""insert into serial_ids values (%s,%s)"""
cur.execute(query, (serial,model))

I am using MySQL in Flask framework but I dont see the row inserted. The same code piece is working with python (no framework).

Also, is there any way to do autocommit true in Flask or some workaround?

1 Answer 1

1

You need to commit the transaction, with con.commit(), where con is your connection.

Have a read through the documentation for SQLAlchemy - using sqlalchemy will automatically commit the transactions.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks burhan, I did the split of instantiating cursor and did the commit. Although thanks for the link. will look into it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.