edit_confirmed = edit_col2.button(“Edit the entry”)
if edit_confirmed:
with st.form(key=‘new-entry’):
##all the necessary edits
#submit button and insert query
submit_button = st.form_submit_button("Insert the Entry")
#Insert statement
if submit_button:
try:
update_entry_statement = f"UPDATE {table_name} SET TITLE = '{edited_title}'' WHERE CODE = '{choosed_code}'"
session.sql(update_entry_statement)
st.success("Entry Edited successfully")
except Exception as e:
st.error(f"Error updating entry: {e}")
I am trying for this code, as for editing part I am trying to add two buttons,
one which allows to opens the form after clicking (edit form button) and after filling out form (submit button) but the changes don’t reflects in table and it returns nothing. The form closes on it own. Please help me!!