I am not sure why this isn't working. I am trying to delete an entry from the database I created. Here is sample of parts of the python code that is erroring out.
delete_domain = 'm.com'
sql.execute('''CREATE TABLE if not exists domains
(name TEXT NOT NULL PRIMARY KEY,
clock CHAR(100) NOT NULL,
person TEXT,
reason TEXT);''')
def searchdb(name):
sql.execute("DELETE FROM domains WHERE name = name;", (name))
sql.commit() # Commit changes to the DB
print("Record successfully deleted")
cursor.close()
searchdb(delete_domain) # Testing method
ERROR below:
sql.execute("DELETE FROM domains WHERE name = name;", (name)) sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 0, and there are 5 supplied.