I want to build a query with several calls where, but I have an error when you use this code
$command = Yii::app()->db->createCommand() ->select('*') ->from('{{table}}'); $command->where('value1 = :value1', array(':value1' => 1)); $command->where('value2 < :value2', array(':value2' => 2));
I understand that I can use code like
$command->where('value1 = :value1 AND value2 = :value2', array(':value1' => 1, ':value2' => 2));
but I have complex conditions and its usage code, for example, the top one, is simpler.
In Codeigniter, I can use this condition several times
$this->db->where()
source share