Yii2: create helper

How to create a new helper in Yii2 framework: Create a new file “Utils.php” in “app-basic\helpers” or in other folder, location is up to you, but keep things organized!

In this helper we have 2 functions to display raw

MySQL Trigger – after insert trigger

I want to populate automaticaly another table when new data is inserted: For table “source_table” define a after insert trigger

The “NEW” alias contains all inserted fields into table “source_table”; After “insert” event on table “source_table”, we set the

mysql: –i-am-a-dummy

This option prevents MySQL from performing update operations unless a key constraint in the WHERE clause and / or a LIMIT clause are provided.

For beginners, a useful startup option is –safe-updates (or –i-am-a-dummy, which has the same effect).