var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Trigger Syntax
I am new to using triggers but would like to set one up so was hoping for some help.
I have two related tables Forumpost and ForumReply.
What I would like to achieve is that when a new record is inserted into the ForumReply table the ForumPost table is updated with the current datetime.
I want to do this at row level and use the ForumPostID field of the newly inserted record in forum reply to select which record to update in forumpost.
The tables are as follows:
DateUpdated - This is the field I want updating
ForumPostID - This is the field that links to ForumpostId in ForumPost table.
Any help to get me started would be helpful
Worked it out
I think I have worked it out. this seems to work, in case anyone else has the same problem:
CREATE TRIGGER `UpdateDate` AFTER INSERT ON `forumreply` FOR EACH ROW Update forumpost
Set forumpost.UpdatedDate = Now()
Where new.PostID = PostID