I am trying to insert data into sqlite database in python. Now when I have a single quote in my variable
data = "This is my apple's seed."
cursor.execute("insert into tableName (ColName) values ('%s')" %data)
it gives error like this:
sqlite3.OperationalError: near "s": syntax error
I know that this problem occurred because I didn't escape characters properly. How do I do that?