Hi all,
Can any one please tell me how to bind params(or values)in cdbcommand statement.Following is my code.
$qtxt ="SELECT l.first_name, l.last_name, m1.subject, m1.message_text
FROM messages m1, messages_user_map m2,user_login l
WHERE m1.message_id = m2.message_id
AND m2.pk_school_id = :schoolid";
$command =Yii::app()->db->createCommand($qtxt);
$schoolId = Yii::app()->user->schoolId;
$schoolid = '%'.$schoolId.'%';
$command->bindValue(":schoolid", $schoolid, PDO::PARAM_INT);
$schools =$command->queryColumn();
$res =$command->queryAll(true);
but the vaules are not getting binded(schoolid)…??