this is my trigger:
CREATE TRIGGER update_avatar
BEFORE INSERT ON `tbl_archivos` FOR EACH ROW
UPDATE `tbl_archivos`
SET `is_avatar`='0'
WHERE `tbl_usuarios_id_usuario`=NEW.`tbl_usuarios_id_usuario`
and this is the error:
#1442 - Can't update table 'tbl_archivos' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
i want to update the state "is_avatar" to 0 on upload file, where the id_usuario = the inserted id_usuario.
Whats wrong?