I want to select data from 4 tables using Active Record class in codeIgniter
My tables: Teacher(id_teacher, name) Student(id_parent, name, id_teacher, id_class,id_school) class(id_class, libelle) School(id_school, name)
Here's my code :
$this->db->select("t.*, s.*, c.*, sh.*");
$this->db->from("teacher t");
$this->db->join("student s","t.id_teacher=s.id_teacher");
$this->db->join("class c","c.id_class=s.id_class");
$this->db->join("school sh","c.id_school=sh.id_school");
$query = $this->db->get();
But it's not working. Can you help me please ?
$this->db->from("teacher t);
in this line...first put closing double quote mark in$this->db->from("teacher t);
as finally$this->db->from("teacher t");
– webDev