alvinchua Posted May 14, 2007 Share Posted May 14, 2007 hi ppl... i am totally new to this stuff and i need to create a trigger before an update operation is occured and i got a sample of trigger from the internet... where should i put this trigger inside <?php ??? 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 "; i need a trigger to update the database when it comes to a particular date... and this is the code for the update... $Total = $valueself- $amount; $Total2 = $payvalue- $amount; echo $Total; //echo $Total2; $payee = $_POST['select']; $queryinsert = "UPDATE personal SET AccountBalance = ('$Total')". "WHERE CusName = 'user1'"; $queryinsertT = "UPDATE tenaga SET OverdueAmount = ('$Total2')". "WHERE CusName = 'user1'"; $queryDate = "UPDATE tenaga SET EffectiveDate= ('$payee')". "WHERE CusName = 'user1'"; how can i do that?? pls advice.. thanks ~ Quote Link to comment https://forums.phpfreaks.com/topic/51270-how-to-use-trigger/ Share on other sites More sharing options...
alvinchua Posted May 14, 2007 Author Share Posted May 14, 2007 anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/51270-how-to-use-trigger/#findComment-252815 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.