Q:

syntax error on mysql query to update in python

here is my query
 x.execute("UPDATE details SET name =%s,"(form.newname)"WHERE name =%s," (form.name))

am getting syntax error.can anyone pls help to fix it

A:

Based on syntax: cursor.execute(sql_query, args)

It should be like:
x.execute("UPDATE details SET name = %s WHERE name = %s", (form.newname, form.name))

