Hi, I have never used a trigger before, and i am confused about the syntax.
My program uses mysql, and the tables i want to interact with are 'orders' and 'updates'
What I want is for whenever the orders table has an update or insert to the column called 'orderType' it will insert into the updates table column 'type' a value that matches the inserted/updated a value that matches the new ordertype and has a timestamp for the second value.
Please let me know if I am not being clear enough, I have never used triggers before.
Trigger an insert upon insert/update
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jignesh TrivediRank #16 · 50.3K reputationPosted Aug 5, 2012, 7:38 PM EDT
for creating trigger with mysql please refer....
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
http://www.roseindia.net/mysql/mysql5/triggers.shtml
i am clear from which column updated in insert opration. please clerify it.
thx
hope this will help you.
patrickRank #4,458 · 342 reputationPosted Aug 5, 2012, 7:51 PM EDT
as ALTER TABLE orders
ADD lastmodified TIMESTAMP
DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP;