cursor
This commit is contained in:
@@ -40,14 +40,15 @@ class Members:
|
||||
# x=["1"]
|
||||
sqv = "SELECT * FROM members WHERE username='"+username+"'"
|
||||
with db:
|
||||
with db.cursor(cursor_factory=NamedTupleCursor) as cursor:
|
||||
#with db.cursor(cursor_factory=NamedTupleCursor) as cursor:
|
||||
with db.cursor() as cursor:
|
||||
cursor.execute(sqv)
|
||||
#cursor.execute(sqv, x)
|
||||
member = cursor.fetchall()
|
||||
|
||||
column_names = [row[0] for row in cursor]
|
||||
|
||||
print("Column names:\n")
|
||||
print("Column names:\n")
|
||||
for i in column_names:
|
||||
print(i)
|
||||
# cursor.execute(sqv,x)
|
||||
|
||||
Reference in New Issue
Block a user