I've mounted an update by grouping the presenca
field that should change from two arrays
to one repeat loop, follow query
:
UPDATE acessos AS a
JOIN
( SELECT usr_id, presenca
FROM acessos
GROUP BY presenca
) AS c
ON a.usr_id = c.usr_id
SET
a.presenca = 1
WHERE a.usr_id = 2
It only works with usr_id = 10
, what can it be?