title: createCommand() function in yii2 returning false value
body: <p>I've made a function 'UpdateSysAcc()' to update a db table's row in yii2 model as:</p>
  
  <p>profile.php</p>
  
  <pre><code>namespace app\models;
  
  use yii\db\ActiveRecord;
  use Yii;
  use yii\base\Model;
  use app\models\Location;
  
  class Profile extends ActiveRecord {
  
      public $Fname;
      public $Lname;
      public $Password;
      public $Mail;
      public $Mobile;
  
  public static function db() {
          $db = new \yii\db\Connection([
              'dsn' =&gt; 'mysql:host=localhost;dbname=cms',
              'username' =&gt; 'root',
              'password' =&gt; '',
              'charset' =&gt; 'utf8',
          ]);
          return $db;
      }
  
  public function UpdateSysAcc($model) {
  
          echo $this-&gt;db()-&gt;createCommand("UPDATE `cms_profile` SET `UserName`='$model-&gt;Fname $model-&gt;Lname',`Mobile1`=$model-&gt;Mobile,`Mail`='$model-&gt;Mail',`ProfileImg`='db.jpg' WHERE `Mail`='$this-&gt;Mail'")-&gt;execute();        
      }
  }
  </code></pre>
  
  <p>controller file for the above model is:</p>
  
  <p>ProfileController.php</p>
  
  <pre><code>namespace app\controllers;
  
  use yii;
  use yii\web\Controller;
  use app\models\Profile;
  use app\models\Location;
  
  class ProfileController extends Controller {
  
      public function actionIndex() {
          $model = new Profile;
          $obj = new Location;
  
          if ($model-&gt;load(\Yii::$app-&gt;request-&gt;post())) {
              if ($model-&gt;UpdateSysAcc($model)) {
                  return $this-&gt;render('index', ['model' =&gt; $model, 'obj' =&gt; $obj]);
              } else {
                  return $this-&gt;render('index', ['model' =&gt; $model, 'obj' =&gt; $obj]);
              }
          } 
      }
  }
  </code></pre>
  
  <p>now the problem with above code is that the UPDATE QUERY in UpdateSysAcc() model function successfully updating table data but createCommand() returning false value.</p>
  
  <p>can anybody help me in this case what is the problem with this code?</p>
  
  <p>database schema for the db table is as follows:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `cms_profile` (
  `Id` int(4) NOT NULL,
    `SysUniqueId` varchar(50) NOT NULL,
    `UserName` varchar(30) NOT NULL,
    `Dob` date NOT NULL,
    `LastActivity` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
    `Mobile1` varchar(15) NOT NULL,
    `Mobile2` varchar(15) NOT NULL,
    `Mail` varchar(50) NOT NULL,
    `ProfileImg` varchar(50) NOT NULL,
    `DrName` varchar(50) NOT NULL,
    `DrMobile` varchar(15) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  </code></pre>