Skip to content
Advertisement

python MySQL update specific column fetchall()

I’m new to python and I want to update every record that has count 0 in the database. I have tried a lot can’t find anything like help.

JavaScript

Advertisement

Answer

Assuming your table has this structure:

JavaScript

Here is the simple code code-

JavaScript

Also, since you mentioned that you are new to python remember to commit, every time, whenever you run INSERT, UPDATE or DELETE like queries.

Hope it helps.

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