I do not know much about Mysql and I need to do a trigger to update a line right after insertion. When the user registers an order he selects how many orders he wants. In the database a type is saved in one column and in another column the amount that it requested. I wish that every time I enter a new request my trigger updates the type field for (quantity-type) My trigger is like this but nothing happens after inserting a new record:
delimiter $$
create trigger Atualiza_Pedido
after insert on loja.pedido for each row
Begin
if new.method = 'metodo'
then
update loja.pedido
set tipo = concat(new.quantidade,'-', new.tipo)
where id = new.id;
end if;
END$$