I am going to save the settings of widgets into database when a button is clicked. Here is a part of the code:
title = st.text_inpur(“Title:”)
category = st.selectbox(…)
… # other data widgets
db = mysql.connector.connect(…)
cur = db.cursor()
sql = … # make a INSERT SQL statement from the widgets input, pls neglect issues of sql injection
I expect it to save data in MySQL after “save” button is clicked. But what happens is, after clicking the button, the corresponding webpage is blocked and showing “Running” all the time, and the database is not changed.
Any advice? Thanks all.