$data = array(array('order_id' => 1,'product_id' => 1,'price' => 99),array('order_id' => 1,'product_id' => 2,'price' => 80));$this->db->update_batch('order_details', $data, array('order_id', 'product_id') );
(10-19-2020, 06:43 PM)huangnam Wrote: Example: I have a MySQL table order_details (order_id, product_id, price). Keys are: order_id and product_id. Codeigniter should allow update batch with multiple keys like this: PHP Code:$data = array(array('order_id' => 1,'product_id' => 1,'price' => 99),array('order_id' => 1,'product_id' => 2,'price' => 80));$this->db->update_batch('order_details', $data, array('order_id', 'product_id') ); Please add this feature. For this solution I use a method like this Mr., you can try, with a declaration like the one below and this worked for more than 1 condition. $this->db->where('product_id','2323'); $this->db->update_batch('erp_manag_md_hargabarang', $data,'order_id');