May-25-2021, 12:56 AM
Is there any way to pull each column entry and make each db entry it's own variable? I know how to pull a single entry at a time using something like
for rows in cursor.execute("SELECT commands FROM CR WHERE ID = [1]):
variable=rows
print(variable)
else:
variable = 0
But I need a way to make variable1 = (column entry 1), Variable2 = (column entry 2), so on and so forth. I'm assuming I would have to use arrays but can't find any guidance online. Any help would be greatly appreciated. Thanks.
for rows in cursor.execute("SELECT commands FROM CR WHERE ID = [1]):
variable=rows
print(variable)
else:
variable = 0
But I need a way to make variable1 = (column entry 1), Variable2 = (column entry 2), so on and so forth. I'm assuming I would have to use arrays but can't find any guidance online. Any help would be greatly appreciated. Thanks.