Advertisement

MySQL Triggers

  • Frank M. Kromann
Chapter

Abstract

A trigger is a task that executes in response to some predefined database event, such as after a new row is added to a particular table. Specifically, this event involves inserting, modifying, or deleting table data, and the task can occur either prior to or immediately following any such event. This chapter begins by offering general examples that illustrate how you can use triggers to carry out tasks such as enforcing referential integrity and business rules, gathering statistics, and preventing invalid transactions. I will then discuss MySQL’s trigger implementation, showing you how to create, execute, and manage triggers. Finally, you’ll learn how to incorporate trigger features into your PHP-driven web applications.

Copyright information

© Frank M. Kromann 2018

Authors and Affiliations

  • Frank M. Kromann
    • 1
  1. 1.Aliso ViejoUSA

Personalised recommendations