Retrieving a usernames corresponding password

hello,

I have a User model.

I have a variable($keyword) to be passed on the db, it will compare itself to all the username listed.

Then, it will return the username’s password. (This is just a dummy test. I will not really send the password in my system)

$model = User::model();

$user = $model->find(array(

		'condition'=> $keyword = ':username',


		'params'=>array(':username' => $keyword)


		));

//Helped coded from XTIAN

So, how do i retrieve the pass?

Chabx

$user->password ?

It says error : Trying to get property of non-object

It should be,




$model = User::model();

$user = $model->find(array(

'condition'=> 'username=:username',

'params'=>array(':username' => $keyword)

));






that means you have tried to find a model that does not exist.

Thank you for all the reply. This topic has been resolved.