Quote:
Originally Posted by Opserty
trigger? 
|
As of MySQL 5.02, you can add 'triggers' to tables. So you can specify things like "when data is inserted into table A, do such-and-such to table B". See:
http://dev.mysql.com/doc/refman/5.0/en/triggers.html
The advantage of this approach is that you don't have to write any PHP code, it just happens automagically within MySQL. The disadvantage is that ... well, you don't have any PHP code and it happens automagically within MySQL. So you can't add any data which can't be derived from a select on existing MySQL data, and you can't handle errors gracefully. And of course it's MySQL version specific.
If all you are doing is literally inserting data already present in your table(s) into another table, triggers are a useful shortcut.
-- hugh