Files
Abschluss-Projekt/backend/check_db.py
2025-11-28 12:50:27 +01:00

15 lines
360 B
Python

import pymysql
conn = pymysql.connect(host='localhost', user='root', password='root', database='myapp')
cursor = conn.cursor()
cursor.execute('DESCRIBE image')
rows = cursor.fetchall()
print("Current 'image' table structure:")
print("-" * 60)
for row in rows:
print(f"Field: {row[0]:<15} Type: {row[1]:<15} Null: {row[2]}")
print("-" * 60)
conn.close()