In my mysql project with python, when trying to modify a field of the table, the sequence sql generates error and I do not understand why. I accept the name change but when I enter the new price the error arises. The Cod
element is the primary key of my table.
This is my code :
sql="update productos set Nombre='"+nombre+"'Precio='"+precio+"' where Cod="+cod
mysql.connection.query(self, query)
And the error that launches:
_mysql_exceptions.ProgrammingError: (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 'Price =' 120 'where Cod = 1' at line 1 ")