E
E
EVOSandru62015-02-25 13:23:02
Yii
EVOSandru6, 2015-02-25 13:23:02

How to perform an OR condition in Yii using ActiveRecord?

Good afternoon,

$user_model = ActiveRecord::model('User')->findByAttributes(array('LOGIN'=>$this->LOGIN, 'EMAIL'=>$this->EMAIL));

How to remake this line so that instead of "AND" there is an "OR" condition?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vit, 2015-02-25
@EVOSandru6

For example like this:

User::model()->findAll('login=:login or email=:email', array('login' => $this->login, 'email' => $this->email))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question