mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 12:24:57 +00:00
try to get data from database
This commit is contained in:
@@ -61,9 +61,16 @@ def phpmyadmin_passthrough(path):
|
|||||||
|
|
||||||
@app.route("/database")
|
@app.route("/database")
|
||||||
def database():
|
def database():
|
||||||
|
try:
|
||||||
cur = mysql.connection.cursor()
|
cur = mysql.connection.cursor()
|
||||||
# cur.execute("SELECT * FROM kobuki_data")
|
cur.execute("SELECT * FROM kobuki_data")
|
||||||
return "hi",404
|
rows = cur.fetchall() # Haal alle rijen op uit het resultaat
|
||||||
|
cur.close()
|
||||||
|
|
||||||
|
return str(rows)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Database error: {e}")
|
||||||
|
return "Er is een fout opgetreden bij het ophalen van de databasegegevens.", 500
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True, port=5000)
|
app.run(debug=True, port=5000)
|
||||||
|
Reference in New Issue
Block a user