我有這個光標錯誤:光標 '對象有沒有屬性' _last_executed
cursor.execute("SELECT price FROM Items WHERE itemID = (
SELECT item_id FROM Purchases
WHERE purchaseID = %d AND customer_id = %d)",
[self.purchaseID, self.customer])
我得到這個錯誤
'Cursor' object has no attribute '_last_executed'
但當我嘗試這個辦法:
cursor.execute("SELECT price FROM Items WHERE itemID = (
SELECT item_id FROM Purchases
WHERE purchaseID = 1 AND customer_id = 1)",
)
有沒有錯誤。我該如何解決?
你終於得到它的工作雙%%的呢? – juankysmith
我有相同的錯誤消息,但使用ORM。事實證明,charset問題用unicode()封裝我的字符串解決了。我知道它不能回答你的問題,但它可能適合於登陸本頁尋找答案的其他人。 –
感謝張貼,湯米,肯定幫我 – Steve