Hi I have a question, I would like to update the user input, in my database. Unfortunately, this only works locally but not when I share the app. Does anyone have an idea what I may not have considered?
My function looks like this:
def update_sql_database_ger(label):
try:
connection_de = sqlite3.connect('////Users/****/Documents/GitHub/****/G****.db', check_same_thread = False)
cursor = connection_de.cursor()
print("Connected to SQLite")
ID = st.session_state.ID
Gender = st.session_state.gender
Index = str(st.session_state.current_index)
Count = 1
sql_update_query = """Update Hate_speech_ger set Label = ?, Individual_ID = ?, Gender =?, Count = ? where index_id = ?"""
data = (label,ID,Gender, Count, Index)
cursor.execute(sql_update_query, data)
connection_de.commit()
print("Record Updated successfully")
cursor.close()
connection_de.close()
except sqlite3.Error as error:
print("Failed to update sqlite table", error)
Thanks for your help!