With the code:
$sql = "SELECT word, question FROM tbl_words WHERE groupid=ex";
$row = Yii::app()->db->createCommand($sql)->queryAll();
print_r($row);
i get the following error
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ex' in 'where clause'. The SQL statement executed was: SELECT word, question FROM tbl_words WHERE groupid=ex