【发布时间】:2012-02-19 14:39:36
【问题描述】:
我无法将数据插入到 sqlite 表中。 这是我的代码:
import sqlite3
connection = sqlite3.connect('mydata.db')
cursor = connection.cursor()
a=raw_input('name')
a=str(a)
b=raw_input('theme')
b=str(b)
c=raw_input('language')
c=str(c)
sql="INSERT INTO Website (Website, Theme, Language) VALUES (%, %, %)",(a,b,c)
cursor.execute(sql)
connection.commit()
connection.close()
由于某种原因它不起作用。
【问题讨论】: