错误提示 Fatal error: Call to a member function bindColumn() on boolean in
问题相关代码
qy表只有三个字段,qyname,qyid,mid
function getqy($qyid,$dblj){
$qy = new mqy();
$sql = "select * from `qy` WHERE qyid=$qyid";
$cxjg = $dblj->query($sql);
$cxjg->bindColumn('qyname',$qy->qyname);
$cxjg->bindColumn('qyid',$qy->qyid);
$cxjg->bindColumn('mid',$qy->mid);
$cxjg->fetch(\PDO::FETCH_ASSOC);
return $qy;
}
我尝试修改如下,依然报错
$cxjg->bindColumn(1,$qy->qyname);
$cxjg->bindColumn(2,$qy->qyid);
$cxjg->bindColumn(3,$qy->mid);