def GetUpdate():
enter = input("What attributes do you want to change ? ")
select,p_id = input("Please enter your attributes separated by space: ").split()
try:
cur.execute("UPDATE Diary SET %s = %s where diary_id = %s",(enter,select,p_id))
#cur.execute(sql, (select, p_id))
con.commit()
print("Updating in table Diary is completed successfully")
except (Exception, ps.DatabaseError) as error:
print(error)
I want to make update function as you see I have 3 input parameters, first is what column in db I want to change .But 2,3 parameters is update parameters. When I'm trying run this code I got error. He takes my first input not as parameter, but as a Variable(string)