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
https://forums.phpfreaks.com/topic/51191-where-to-put-the-trigger-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.