我有这个光标
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)",)
解决方法
我也遇到这个问题.我将%d更改为%s,并将其解决.希望这对你有用.