Posts

Showing posts with the label join

How To Update A Joined Tables Using Codeigniter's Active Record?

Codeigniter active tape doesn't let to update a joined tables. After trying diverse method as well as searching the solution, I accept institute the next solution which does the precisely same affair i.e. update the multiple bring together tables. By using next method, you lot tin update multiple tabular array using codeigniter active record. $this->db->set('a.firstname', 'Pekka'); $this->db->set('a.lastname', 'Kuronen'); $this->db->set('b.companyname', 'Suomi Oy'); $this->db->set('b.companyaddress', 'Mannerheimtie 123, Helsinki Suomi'); $this->db->where('a.id', 1); $this->db->where('a.id = b.id'); $this->db->update('table every mo a, table2 every mo b'); Sumber http://developer-paradize.blogspot.com

How To Bring Together Multiple Tables Inward Codeigniter?

By using CodeIgniter's Active Record class, yous tin forcefulness out only utilization the bring together method multiple times to bring together multiple tables. $this->db->select('*'); $this->db->join('table2', 'table2.ID = table1.ID'); $this->db->join('table3', 'table3.ID = table1.ID'); $this->db->from('table1'); Permits yous to write the JOIN component division of your query. If yous require a specific type of JOIN yous tin forcefulness out specify it via the 3rd parameter of the function. Options are: left, right, outer, inner, left outer, together with correct outer. $this->db->join('table4', 'table4.ID = table1.ID', 'left'); // Produces: LEFT JOIN table4 ON table4.ID = table1.ID Read to a greater extent than especial on https://ellislab.com/codeigniter/user-guide/database/active_record.html Sumber http://developer-paradize.blogspot.com