我正在研究项目,我的rsult查询给出了多个记录,但是我只想一次记录每条记录,我在此查询中使用了内部联接?

时间:2018-08-15 09:58:35

标签: codeigniter

$this->db
    ->select(array('courses.Course_Name','teacher.First_Name','teacher.Last_Name','teacher.Reg_Id','teacher_assignment.Assignment_Id','Assignment_Url','assignment.Solution_Url','assignment.Status','courses.Course_Id')); 
$this->db
    ->from(array('student_registration')); 
$this->db
    ->join('courses','student_registration.Course_Id=courses.Course_Id','inner'); 
$this->db
    ->Join('teacher_assignment','teacher_assignment.Course_Id=courses.Course_Id','inner'); 
$this->db
    ->Join('assignment','assignment.OEN_Number = student_registration.OEN_Number','teacher_assignment.Reg_Id = assignment.Reg_Id','inner'); 
$this->db
    ->Join('teacher','teacher.Reg_Id = assignment.Reg_Id','inner'); 
$this->db
    ->where(array('student_registration.OEN_Number'=> $uid)); 

$query = $this->db->get();

0 个答案:

没有答案