I need to use crypt function inside active record query. Mysql query : SELECT id FROM users WHERE email = ‘email@example.com’ AND password_hash = crypt(‘johnspassword’,password_hash); I want to convert it into active record query in yii1.My query like below. But its showing error.
$criteria = new CDbCriteria();
$criteria->condition = ‘username = :username AND password_hash = :password’;
$criteria->params = [’:username’ => $this->username, ‘:password’ => crypt($this->password, password_hash) ];
$user = User::model()->find($criteria);
how to use password_hash field inside crypt function?