mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
test to get db info
This commit is contained in:
@@ -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}")
|
||||||
|
Reference in New Issue
Block a user