15 lines
375 B
Python
Executable File
15 lines
375 B
Python
Executable File
import pymysql
|
|
|
|
conn = pymysql.connect(host='localhost', user='root', password='root', database='myapp2')
|
|
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()
|