I am trying to retrieve information from the database and display it in this certain way:
Name: Batman
Price: £ 18
But I am getting this error: "TypeError: 'int' object is not subscriptable."
How can I fix that?
c.execute("SELECT name, price FROM products WHERE id=02")
records = c.fetchone()
# print(records)
print_products = ''
for record in records:
print_products += 'Name:' + str(record[0]) + '\n' + 'Price: £' + str(record[1])
query_label = Label(frame, fg='darkblue', bg='darkgray', text=print_products)
query_label.pack()