我试图创建一个活动查询,其中子查询中有一个变量
$fb_UID = $this->session->userdata('fb_UID');
$qs = $this->db->select("*,qs.UID as qs_UID")->
from("question_set qs")->
join("questions q","qs.UID=q.fk_question_set_UID","inner")->
where("sickness_UID",$id)->
where('`qs.UID` NOT IN(SELECT `fk_question_set_UID` FROM `solved_qset` where fk_fb_UID = `$fb_UID`)', NULL, FALSE)->
group_by("qs.UID","asc")->
order_by("qs.UID","random")->
get()->row();
但我得到一个错误
Unknown column '$fb_UID' in 'where clause'
有没有办法在活动记录子查询中正确放置变量?
谢谢