This is a discussion on how to create trigger in MYSQL within the Database Support forums, part of the Web Development category; HI, how to create trigger in MySql using PHP?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi Ashok, Is there any possibilty that we have fire triggers in PHP? Ok. First we have to start with creation of triggers in MySql. Do you have any idea about creating trigger in MySql?
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| hi... A trigger is a named database object that is associated with a table, and that activates when a particular event occurs for the table. To know more about the trigger, reffer the following link. MySQL AB :: MySQL 5.0 Reference Manual :: 18 Triggers Regards, S.Ashokkumar |
| |||
| hi, Thanks for your reply. But i think we can execute of creating triggers in PHP script is itself For example, $query = "CREATE TRIGGER ins_sum BEFORE INSERT ON account FOR EACH ROW SET @sum = @sum + NEW.amount;"; mysql_query($query); is it possible?
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| PHP Code: I have marked the Syntax error in the Stated Query $query = "CREATE TRIGGER ins_sum BEFORE INSERT ON account FOR EACH ROW SET @sum = @sum + NEW.amount;END;"; mysql_query($query);
__________________ -Murali.. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setup a clock with defined alarm times which trigger another event | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 03-04-2008 09:57 PM |
| How to create UDF function in Mysql | Murali | Database Support | 1 | 12-01-2007 02:03 AM |
| Can we have a commit statement inside a trigger? if no why cant we? | Mramesh | Database Support | 6 | 09-11-2007 03:08 AM |
| Run an exe from an oracle trigger | H2o | Database Support | 5 | 08-09-2007 11:55 AM |
| Storing the output from trigger in a text file | sureshbabu | Database Support | 3 | 07-27-2007 06:44 AM |