Tag Archives: Query

Yii2 Data Manipulation in Database

Data Manipulation is quite easy to do in Yii2 and most of the methods are the same as in Yii were but with slight variation in syntax.

Following are the example of various Active Record methods:

To insert a new customer record:

To update an existing customer record:

To update an existing customer record:

To delete an existing customer record:

To delete several customers:

To increment the age of ALL customers by 1:

Happy Coding!