9.1.6 TriggersThis is NOT the latest copy of this book; click here for the latest version.
Triggers allow you to add functionality to your tables so that they perform a certain series of actions whenever a defined query is made. For example, it is possible to have your DBMS recalculate certain values whenever new records are added, or whenever more than ten rows have been read at once.
Triggers are not available in MySQL 4, and are destined for MySQL 5. Many people find triggers problematic because they are hard to debug, and often cause unexpected actions. However, if used properly they fulfil a role that nothing else can, and so can help a great deal.
|
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.
My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!
|