lampongyuen commited on
Commit
ac44277
·
1 Parent(s): c931402

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -54,12 +54,12 @@ def main():
54
 
55
  elif option=="Update":
56
  st.subheader("Update a Record")
57
- name=st.text_input("Enter Name")
58
  new_email=st.text_input("Enter New Email")
59
  if st.button("Update"):
60
- sql="update users set email=%s where name=%s"
61
- val=(name,new_email)
62
- mycursor.execute(sql,val)
63
  mydb.commit()
64
  st.success("Record Updated Successfully!!!")
65
 
 
54
 
55
  elif option=="Update":
56
  st.subheader("Update a Record")
57
+ search_name=st.text_input("Enter Name")
58
  new_email=st.text_input("Enter New Email")
59
  if st.button("Update"):
60
+ sql="update users set email=new_email where name=search_name"
61
+ # val=(name,new_email)
62
+ mycursor.execute(sql)
63
  mydb.commit()
64
  st.success("Record Updated Successfully!!!")
65