if(isset($_GET['keyword']))
{
$keyword=$_GET['keyword'];
$user = ''; //if i don't initialize this, there will be an error stating that $user is undefined.
$model = User::model();
$user = $model->find(array(
'condition'=>'username = :username',
'params'=>array(':username'=>$keyword)
));
//And finally retrieve user's password
$password = $user->password;
You have a mistake on line 19
'condition'=>$keyword = ':username',
"condition" is actually the SQL condition. So you just have to type 'username = :username' (which in SQL syntax is something like this : "SELECT * from ... WHERE <<condition>> LIMIT...").
":username" is a parameter that should be passed on to the query. So if you are searching for username = $keyword, params array will look like this
'params'=>array(':username'=>$keyword)
Hope this was helpful.
Never leave your job unfini...