Hey!

so..I want to update the amount of total sales by a user...

If I want to do it from PHP it will result in too many DB queries, so I was wondering if anyone knows a way to do it by using a TRIGGER that updates an specific field from that specific user on update..

I'm thinking something like

BEFORE UPDATE (or should it be AFTER?)

total_sales = OLD.total_sales + NEW.total_sales

Thank you in advance