0
进口的sqlite3我有这样的代码:与其中var LIKE语句
Title= "somewords"
itemID = somenumbers
import sqlite3
db = sqlite3.connect('C:\\db.sqlite')
cursor = db.cursor()
cursor.execute('SELECT itemID FROM itemAttachments WHERE path LIKE "%?%" ', (Title,))
cursor.execute('SELECT key FROM items WHERE itemID =? ', (itemID,))
第二条语句与where item=?
作品,但第一个与like
让我烦恼。
我已经尝试了许多combinaisons像"+Title+"
和{} .format(Title)
,添加或删除“%...%"
但每次我得到一个错误:要么sqlite3.ProgrammingError: Incorrect number of bindings supplied
或sqlite3.OperationalError: near ",": syntax error