Hi when I update data with sql, I get a string error. Please help me.
This is my error:
TypeError: not enough arguments for format stringimport pymysql.connect string error
My code is as follows:
db = mysql.connector.connect(user='root', password='1234', host='localhost', database='sosyalbe')
cursor = db.cursor()
cursor.execute("SELECT * FROM siparisler WHERE siparis_durum ='İptal'")
order = cursor.fetchone()
id = order[0]
dss = 10
cursor.execute("UPDATE siparisler SET urun_baslangic = '%s' WHERE order_id ='%s'" %dss % id) #errror
cursor.execute("UPDATE siparisler SET urun_baslangic = (?) WHERE id = (?)" (dss, id)) #ERROR
please help !