我查詢時完全轉化爲:錯誤在Python:不參數字符串格式化
z = request.session['username']
cursord.execute("delete from table where column = %s",z)
得到錯誤不參數字符串格式化過程中完全轉化。
query = query % tuple([db.literal(item) for item in args]) TypeError: not all arguments converted during string formatting "GET /logout/ HTTP/1.1" 500 68562
如何解決這個問題?
你可以編輯你的問題發佈完整的錯誤堆棧跟蹤,因爲它很容易調試。 –
什麼是打印(z),z可能不是您期望的字符串 – putonspectacles
z正在打印爲用戶名 – zinc