![](/img/trans.png)
[英]Python mysql.connector error while inserting boolean into mysql database
[英]Getting error while inserting in MySQL table using Python MYSQL.Connector
這是我的代碼:
sql = "INSERT INTO haircolor (x_pos, y_pos, width, height,filename,hair_color) VALUES (%s, %s, %s, %s, %s, %s)"
print ("Values",(x_pos, y_pos, width, height,filename,hair_color))
mycursor.execute(sql, (x_pos, y_pos, width, height,filename,hair_color))
mydb.commit()
輸出:
值:33.897543,28.304444444444444,2.7566544,4.9043634,'1(copy1).jpg
,
黑色`
錯誤
處理格式參數失敗python'str_'無法轉換為mysql類型
看起來好像你的文件名和發色變量中有未轉義的后引號......這對任何事都沒有幫助......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.