test to get db info

This commit is contained in:
ishak jmilou.ishak
2024-12-17 13:42:14 +01:00
parent c0186f935d
commit df6a49bbaa

View File

@@ -64,11 +64,9 @@ def phpmyadmin_passthrough(path):
@app.route("/database")
def database():
try:
cur = cnx.cursor()
cur.execute("SELECT * FROM kobuki_data")
rows = cur.fetchall() # Haal alle rijen op uit het resultaat
cur.close()
with cnx.cursor() as cur:
cur.execute("SELECT * FROM kobuki_data")
rows = cur.fetchall() # Haal alle rijen op uit het resultaat
return str(rows)
except Exception as e:
print(f"Database error: {e}")