I have the action in the main controller:
on the condition i have the mistake:
what is wrong and how to resolve this problem.
P.S. i am newbie in YII
public function actionIndex()
{
$criteria = new CDbCriteria();
$criteria->condition = 'carousel == 1';
$carousel = Cars::model()->findAll($criteria);
$this->render('index', array(
'carousel' => $carousel,
));
}on the condition i have the mistake:
Quote
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 '== 1' at line 1. The SQL statement executed was: SELECT * FROM `primauto_cars` `t` WHERE carousel == 1
what is wrong and how to resolve this problem.
P.S. i am newbie in YII