Trigger add old to new
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
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread