def CreateTable():
con = sqlite3.connect('Exhibition.db')
cur = con.cursor()
cur.execute('''CREATE TABLE Crafts (ID int, META text, Design text, Photo text, Ratings text);''')
con.commit()
con.close()
def GetPhotoFromDB(ID=0):
con = sqlite3.connect('Exhibition.db')
cur = con.cursor()
for row in cur.execute('SELECT * FROM Crafts'): # ORDER BY META
kek = row
if row[0] == ID:
break
if kek[0] != ID:
print('photo not found!!!', 'ID: ', ID, 'Index: ', kek[0])
return 'photo no found'
return kek[3]
con.commit()
con.close()
даже если kek[0] равно 2 и ID равно 2, то всё равно photo not found
пробовал создать переменную например
realID: int = 0
realID = kek[0]
но тоже не робит
fetchall()
забыли sqlitetutorial.net/sqlite-python/sqlite-python-select