{
$res = array();
$id = $_SESSION['erc_tempId'];
$qtxt ="SELECT clnt_name FROM erc_client WHERE clnt_name LIKE :clnt_name AND clnt_typeid = $id";
$command =Yii::app()->db->createCommand($qtxt);
$command->bindValue(":clnt_name", '%'.$_GET['term'].'%', PDO::PARAM_STR);
$res =$command->queryColumn();
echo CJSON::encode($res);
Yii::app()->end();
}
note
The scenario here is the data is depending on a dropdown post in the method actionUpdateclient and it will pass a session variable in the actionStoreclient method for query.
I don’t know why the public variable I declared for this controller cannot handle the value of my post, So I decided to store it to Session. Hope it could help! Thanks!