CodeIgniter Update a row of two tables CodeIgniter Update a row of two tables codeigniter codeigniter

CodeIgniter Update a row of two tables


Make me correct if I am not wrong.In Codeigniter, You can't update multiple tables with one SQL statement. Codeigniter does allow you to use transactions though. like below

$this->db->trans_start();$this->db->query('AN SQL QUERY...');$this->db->query('ANOTHER QUERY...');$this->db->query('AND YET ANOTHER QUERY...');$this->db->trans_complete();

Here are the complete documents for this Transactions please check it out...which will also help you to run both queries together, Advantage of using transaction it will only insert data when both query return success...