Python public recipes
This code updates a column in a table with a specific value.
Library: mysql-connector-python
cursor = db.cursor() # db is created with mysql.connector.connect()
stmt = "UPDATE table SET col_to_update=%s WHERE col_to_filter=%s"
cursor.execute(stmt, (new_value, filter_value, ))
db.commit()
cursor.close()