我试图让老师的评论显示出来,但我不断收到此错误:
严重性:注意 消息:试图获取非对象的属性“ teacher_comment” 文件名:student / getstudent.php 行号:3148
public function GetTeacherComment($student_id, $session_id)
{
$this->db->select('*');
$this->db->where('student_id', $student_id);
$this->db->where('session_id', $session_id);
return $this->db->get('teacher_comments')->row();
}
$data['teacher_comment'] = $this->Comment_model->GetTeacherComment($id, $student_session_id);
<span style=" bottom: -20px; position: relative;"> <color style="color:blue;"> CLASS TEACHER'S REMARK:</color> <b
style="text-transform: uppercase;"><?php echo $teacher_comment->teacher_comment; ?> </b></span><br>