CodeIgniter Forums

Full Version: How to update joined tables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been searching for an answer to this, but evidently the working solution for v2 doesn't work in v3.

$this->db->set('a.firstname', 'Pekka');
$this->db->set('a.lastname', 'Kuronen');
$this->db->set('b.companyname', 'Suomi Oy');
$this->db->set('b.companyaddress', 'Mannerheimtie 123, Helsinki Suomi');

$this->db->where('', 1);
$this->db->where(' =');
$this->db->update('table as a, table2 as b');

That code came from here -

Does anyone have a working solution please?

Yours Roy
Bee Creative Web Design
I didn't event know you could make an update on joined tables. What is the advantage over 2 simple updates?