Skip to content
Advertisement

python how to write an update sql query?

I am trying to write an update query but I could not manage the string. My connections is ok. My query is like this:

JavaScript

This is giving me error: undefined column name ‘hello’. I want to update message column as hello but it is getting it as a column name. In sql, when I write it as UPDATE users SET message = 'hello' WHERE UserId=13 it works but I could not figured out how should I write my query like that in python. How should I write my query?

Advertisement

Answer

try it:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement