My environment:
- Python 3.6.5
- SQLite 3.28.0
I am struggling to save a single quote in the sqlite3 database.
import sqlite3
class Database:
def __init__(self):
self.dbpath = 'db.sqlite3'
self.conn = sqlite3.connect(self.dbpath)
self.c = self.conn.cursor()
db = Database()
def update_comment(name, comment='null'):
db.c.execute('update twitter_users set comment = ? where name = ?', (comment, name))
db.conn.commit()
update_comment('Jikkenndesu', "How's day?")
But if I execute select * from twitter_users;
, it output Jikkenndesu|Hows day?
. The single quote is banished.
How can I solve this issue? `