Welcome Guest, Not a member yet? Register   Sign In
CI3 Update Multiple Tables

Did the active record/query builder update functionality decrease from CI2 to CI3? I'm trying to use the query builder to update multiple tables (actually, only updating one table but it joins on another).

For example, something like the below would work in CI2:

$this->db->set('table1.field1', true);
$this->db->where('table1.id', 100);
$this->db->update('table1, table2');

Now, in CI3, it seems that the query builder is crapping out in trying to escape the values in the ->update() function. I've tried various input variations for the ->update() function, but it always results in the wrong escape values.

Examples are:
->update('table1, table2') would produce ...`table1,` `table2`...
->update('table1 , table2') would produce ...`table1 ,` `table2`...

Is there a resolution to this? I would hate to have to go through all my CI2 code and rewrite all the functions that update more than one table in the same query.

Messages In This Thread
CI3 Update Multiple Tables - by kft101 - 02-12-2018, 09:25 AM
RE: CI3 Update Multiple Tables - by dave friend - 02-12-2018, 11:25 AM

Theme © iAndrew 2016 - Forum software by © MyBB