How to delete a record from table?

Viewed 62305

I have a problem with deleting a record from my SQLite3 database:

conn = sqlite3.connect('databaza.db')
c = conn.cursor()
data3 = str(input('Please enter name: '))
mydata = c.execute('DELETE FROM Zoznam WHERE Name=?', (data3,))
conn.commit()
c.close

Everything is OK, no errors, but the delete function doesn't work!

Does anyone have an idea?

7 Answers

I'm using Python 3.9 on windows.

c.execute("DELETE FROM Zoznam WHERE Name={0}".format(data3))
conn.commit()
Related