From 44f9ee45fd85c1a9d2e551144af962fcf13e336b Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Thu, 18 Apr 2024 12:51:09 +0200 Subject: [PATCH] Added delete button --- app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.py b/app.py index 47a7904..8e2c6df 100644 --- a/app.py +++ b/app.py @@ -24,6 +24,12 @@ def delete(tmp): if request.method == "GET": print("GET") print(tmp) + tables = ['inventory', 'sets', 'minifigures', 'missing'] + for t in tables: + cursor.execute('DELETE FROM ' + t + ' where u_id="' +tmp+ '";') + conn.commit() + cursor.close() + conn.close() return redirect('/') @app.route('/create',methods=['GET', 'POST'])