I'm developing with Flask and MySQL. Problem is: I have test table with this values id | resource_name | +----+---------------+ | 1 | google | | 2 | google | | 3 | google | | 4 | google |
In Python I have this:
def edit_resource(res_name, res_id):
with db_pool().manager() as conn:
cursor = conn.cursor()
sql = """UPDATE `resource` SET `resource_name` = %s WHERE id = %s;"""
cursor.execute(sql, (res_name, res_id))
conn.commit()
return True
When this query executed and I put id that not exists answer from DB is "query ok". Please help me to catch problem!