Jump to content

where to put the TRIGGER CODE ???


alvinchua

Recommended Posts

hi ppl.. i need to use trigger for my project and ... can i knoe where do i need to put this trigger code?? inside <? php  currently using MFrontpage to do the stuffs... and i not so sure about the NEW and OLD function in this example ... i need to make trigger like a payment will automatically pay when it comes to a date.. pls advice.. ( below is just an example of trigger)

 

 

 

mysql> delimiter //
mysql> CREATE TRIGGER updtrigger BEFORE UPDATE ON tenaga
    -> FOR EACH ROW
    -> BEGIN
    -> IF NEW.EffectiveDate = date THEN
    -> SET NEW.Salary=10000;
    -> ELSEIF NEW.Salary>500 THEN
    -> SET NEW.Salary=15000;
    -> END IF;
    -> END
    -> //

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.