title: how to execute sql query in yii?
body: <p>I want to execute a query in a view page in Yii, here is my code:</p>
  
  <pre><code>$connection=Yii::app()-&gt;db;
  $connection-&gt;active=true;
  $sql = "insert into news(idNews, news, display) values('', 'anything', 0)";
  $command=$connection-&gt;createCommand($sql);
  $command-&gt;execute();
  </code></pre>
  
  <p>but nothing is happened, what is the error with my code?</p>