So I have a Flask website and when checking for duplicate contacts and wanting to remove them from the user's contact list I run the following:
cmd = "DELETE FROM contacts WHERE contact LIKE '{0}'.format( str(contact_) )"
cur.execute(cmd)
conn.commit()
conn.close()
I've got a print statement in there checking the cmd variable replaces {0} w/ the value of contact_ (the underscore is intentional). So why wouldn't it work?
Extra info because everyone always asks even if it's irrelevant: My OS: Xubuntu Python Version: 3 An example of what the cmd variable could look like is "DELETE FROM contacts WHERE contact LIKE 'Ilovecake'