代码在第 8、9、10、11 行的控制器中显示错误,试图获取非对象的属性。
//检查所有列名和表名。
我的模型是
public function getEducationDetail($educationID) {
$this->db->select('qual_id,pass_year,institute,percentage,emp_id');
$this->db->from('emp_edu');
$this->db->where('edu_id', $educationID);
$this->db->where('del_flag', 0);
$query = $this->db->get();
if ($query->num_rows() > 0):
return $query->result();
else:
return 0;
endif;
}
我的控制器是
public function getEducationDetail() {
$this->load->model('mod_admin');
if (isset($_GET['param'])):
$educationID = $this->input->get('param');
$result = $this->mod_admin->getEducationDetail($educationID);
$jsonArr = array(
'qualificationID' => $result->qual_id,
'passOut' => $result->pass_out,
'institute' => $result->institute,
'percentage' => $result->percentage
);
endif;
$json = json_encode(array('result' => $jsonArr));
echo $json;
}