In the last few sections, we have looked at different scenarios for adding, updating, and deleting data. These are considered to be common operations in an everyday environment. However, what if we would like to watch certain events and use these events to perform another operation? As in, have an audit table that keeps a track of the user on whom an operation was performed or, assuming that there is a limit on the number of students that can register for a course, subtract that number whenever a student registers for the course. In our case, let's take a look at how an audit table can be used to keep track of different operations on a user. MariaDB provides the TRIGGER
statement, which is a chain reaction that is set off in response to a SQL DML operation such as INSERT
, UPDATE
, or DELETE
. To track these changes, let's build an audit table that would hold the person who performed the operation, the time when the operation was made, the type of the operation (INSERT...
Building a Web Application with PHP and MariaDB: A Reference Guide
By :
Building a Web Application with PHP and MariaDB: A Reference Guide
By:
Overview of this book
Table of Contents (17 chapters)
Building a Web Application with PHP and MariaDB: A Reference Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
CRUD Operations, Sorting, Filtering, and Joins
Advanced Programming with MariaDB
Advanced Programming with PHP
Setting Up Student Portal
Working with Files and Directories
Authentication and Access Control
Caching
Performance Optimization
Index
Customer Reviews