Код: Выделить всё
$criteria=new CDbCriteria();
$criteria->addCondition('from=:from');
$ssid=Yii::app()->session->sessionID;
$criteria->params=array(':from'=>$ssid);
$criteria2=new CDbCriteria();
$criteria2->addCondition('question_id=:question_id');
$criteria2->params=array(':question_id'=>$_POST['Questions']['id']);
$isReady=QuestionResults::model()->findAll($criteria);
Но если я сделаю запрос по второй критерии, то он пройдет. Где я не прав?CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from='fb5u74r3m7q82sl19s1kq1rhb2'' at line 1. The SQL statement executed was: SELECT * FROM `sctest_tblQuestionResults` `t` WHERE from=:from