我正在使用python 2.7并尝试将LIKE方法与sqlite3
一起使用search1 = self.lineEdit.text()
search = unicode(search1)
conn = sqlite3.connect('storage/container.db')
c = conn.cursor()
c.execute("SELECT * FROM reports WHERE LIKE('؟%',outIn)=1 OR LIKE('؟%',itemName)=1 OR LIKE('؟%',itemUser)=1", (search, search, search, ))
给了我一个错误:
Traceback (most recent call last):
File "C:\python\townoftechwarehouse\reports.py", line 67, in create_report
c.execute("SELECT * FROM reports WHERE LIKE('؟%',outIn)=1 OR LIKE('؟%',itemName)=1 OR LIKE('؟%',itemUser)=1", (search, search, search, ))
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 0, and there are 3 supplied.
[Finished in 18.2s]