Showing posts with label Yii2 update where condition. Show all posts
Showing posts with label Yii2 update where condition. Show all posts

Wednesday, March 28, 2018

Yii2 update column with query builder

Yii2 also provide update method for update the table records.

In below example we are just updating the single record with where condition.

How to update record in Yii2

Yii::$app->db->createCommand()
             ->update('tblName', ['name' => 'Ram'], ['id'=> 4])
             ->execute();

Recent Update

yii2 session handling

use yii\web\Session; $session = Yii::$app->session; // start session $session->open(); // close session $session->close(); ...

Most Search