CI 3.1.0 multi delete and update, is a bug? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: CI 3.1.0 multi delete and update, is a bug? (/showthread.php?tid=65869) |
CI 3.1.0 multi delete and update, is a bug? - serialkiller - 08-02-2016 In a method I have two queries, the first performs a delete on two tables and everything works well. After I have a second query to update another table in this way: PHP Code: // Delete The update query fails because it inherits the where clause of the delete query like this: …WHERE id_pdv = 123 AND id = 123 This only happens if the delete query receives multiple tables. To get the expected result is necessary: 1) Run two separate delete or 2) Use the delete this way: PHP Code: $this->db->delete( ['table_1','table_2'], ['id_pdv' => (int)$id] ); or 3) Perform PHP Code: $this->db->reset_query(); before the update I'm wrong, or is it a bug? Thanks |