For some reason, the request does not want to work:
UPDATE table SET field1 = IF(field2 = 0, 1, field1) WHERE id = ' . $id;
Did I build it right? It is necessary, depending on the value of the field, to write another value in it or leave it as before.