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") @app.route("/database")
def database(): def database():
try: try:
cur = cnx.cursor() with cnx.cursor() as cur:
cur.execute("SELECT * FROM kobuki_data") cur.execute("SELECT * FROM kobuki_data")
rows = cur.fetchall() # Haal alle rijen op uit het resultaat rows = cur.fetchall() # Haal alle rijen op uit het resultaat
cur.close()
return str(rows) return str(rows)
except Exception as e: except Exception as e:
print(f"Database error: {e}") print(f"Database error: {e}")