• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI 3.1.0 multi delete and update, is a bug?

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
$this->db->where('id_pdv', (int)$id)->delete( ['table_1''tabel_2'] );

// Update
$this->db->where('id', (int)$id)->update('pdv'$array_update); 

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


2) Use the delete this way:

PHP Code:
$this->db->delete( ['table_1','table_2'], ['id_pdv' => (int)$id] ); 


3) Perform

PHP Code:

before the update

I'm wrong, or is it a bug?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.