$paperid=I('id');
$papers=$paper->find($paperid);
//实例化选择题数据库对象
$singlechoice = D('singlechoice');
$singles = $singlechoice -> where("sin_course = '化学类'") -> limit($papers['pa_sin_num']) -> order('rand()')-> select();
$this->assign('singles',$singles);
//实例化判断题数据库对象
$judge = D('judge');
$judges = $judge -> limit($papers['pa_jud_num']) -> order('rand()')-> select();
$this->assign('judges',$judges);
$this->display();
怎么在where中使用变量来比较科目,
最佳答案