我正在尝试使用 sqlite3 模块使用 python 连接到数据库,但出现错误 - sqlite3.OperationalError: near "index": syntax error
我为此搜索了一些解决方案,但没有得到解决方案。我是 sqlite3 的新手
def insert_into_db(url, title, description, keywords):
con = sqlite3.connect('index.db')
c = con.cursor()
create = r'''CREATE TABLE IF NOT EXISTS index (id INTEGER NOT NULL AUTO_INCREMENT,url VARCHAR,description TEXT,keywords TEXT);INSERT INTO index(url, title, description, keywords)VALUES('{}','{}',{}','{}');'''.format(url, title,description, keywords)
c.execute(create)
con.commit()
con.close()
烙印99
慕勒3428872
相关分类