Multiple Joins in Codeigniter in PHP
This code show Multiple Joins in Codeigniter.You can use this code in your projects to ease your work.- $this->db->select('*');
- $this->db->from('TableA AS A');// I use aliasing make joins easier
- $this->db->join('TableC AS C', 'A.ID = C.TableAId', 'INNER');
- $this->db->join('TableB AS B', 'B.ID = C.TableBId', 'INNER');
- $result = $this->db->get();
- join('TableName', 'ON condition', 'Type of join');
- $this->db->select('*');
- $this->db->from('TableA AS A');// I use aliasing make joins easier
- $this->db->join('TableC AS C', 'A.ID = C.TableAId', 'INNER');
- $this->db->join('TableB AS B', 'B.ID = C.TableBId', 'INNER');
- $result = $this->db->get();
Posted on 20:35 / 0
comments / Read More