第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

更新Mysql中的行

更新Mysql中的行

森林海 2021-03-16 15:14:08
我正在嘗試更新MySQL DB中的數(shù)據(jù),但它拋出錯(cuò)誤:UPDATE scrapedDataTable  SET productDesc=,                             moreProductImages=full/545521_1363869251%20copy-500x500.jpg,full/545521_1363869251%20copy-275x275.jpg,full/545522_1363869309%20copy-500x500.jpg,full/545522_1363869309%20copy-74x74.jpg, ,productCategory=Clothing,                             productSubCategory=NA  WHERE Server=http://1click1call.com/Jeans-Shirts-Tshirts-Trousers/W-for-Woman-Kurta-54552And error:(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'moreProductImages=full/545521_1363869251%20copy-500x500.jpg,full/545521_13638692' at line 1")"(<class '_mysql_exceptions.ProgrammingError'>)"我的表結(jié)構(gòu)是:+--------------------+---------------+------+-----+---------+-------+| Field              | Type          | Null | Key | Default | Extra |+--------------------+---------------+------+-----+---------+-------+| productTitle       | varchar(100)  | NO   |     | NULL    |       || productSite        | varchar(1000) | NO   |     | NULL    |       || productDesc        | text          | YES  |     | NULL    |       || productURL         | varchar(325)  | NO   | PRI | NULL    |       || productMRP         | varchar(200)  | YES  |     | NULL    |       || productPrice       | varchar(200)  | YES  |     | NULL    |       || productCategory    | varchar(50)   | YES  |     | NULL    |       || productSubCategory | varchar(50)   | YES  |     | NULL    |       || imageURL           | text          | YES  |     | NULL    |       || moreProductImages  | text          | YES  |     | NULL    |       |+--------------------+---------------+------+-----+---------+-------+詢問 :cursor.execute("UPDATE scrapedDataTable  SET productDesc=%s,moreProductImages='%s', ,productCategory=%s, productSubCategory=%s  WHERE productURL=%s" %(productDesc,image_paths,productCategory,productSubCategory,productURL))誰能幫我...
查看完整描述

2 回答

?
jeck貓

TA貢獻(xiàn)1909條經(jīng)驗(yàn) 獲得超7個(gè)贊

由所有Python SQL庫實(shí)現(xiàn)的Python數(shù)據(jù)庫API使用已參數(shù)化的查詢-本手冊(cè)中沒有涉及到PHP中常見的無用的參數(shù)廢話轉(zhuǎn)義。您需要%s在查詢中的s周圍舍棄單引號(hào),而不是使用%運(yùn)算符手動(dòng)(且容易注入)將參數(shù)格式化為查詢格式,而%用逗號(hào)替換,以將參數(shù)作為第二個(gè)參數(shù)傳遞給execute()

查看完整回答
反對(duì) 回復(fù) 2021-03-27
  • 2 回答
  • 0 關(guān)注
  • 220 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)