Type the phpmyadmin address in the browser, enter the administrator username and password, and enter the phpmyadmin management page.
#After entering, select the database where the operation object is located. Click [SQL] directly in the menu of the database overview and type the code to create the trigger. Click [Execute].
After creation, click on the data table corresponding to the trigger condition in the trigger to view its [Structure]. Click [Details...] at the bottom of the structure.
Scroll to the bottom of the interface, and the trigger you just created will be in the bottom right corner. Can be edited or deleted. Multiple triggers can be created, but they cannot have the same name. Generally, it is written in the trigger that if the name is the same, the creation will be cancelled.
After clicking the edit button, modify the trigger. Let's take a look at the syntax of triggers:
create trigger <触发器名称> { before | after} {insert | update | delete} on <表名> for each row <触发器SQL语句>
"Stories" are all in the
create trigger
{ before | after}: Used to specify whether to trigger before the insert, update or delete statement is executed or after the statement is executed.
on
For each row: The execution interval of the trigger, for each row notifies the trigger to perform an action every other row, rather than once for the entire table.
Creation completed!
Recommended related articles and tutorials:phpmyadmin tutorial
The above is the detailed content of How to create triggers in phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!