This is the query that i\'m trying to achieve via active record:
UPDATE `Customer_donations` cd join Invoices i on i.cd_id = cd.cd_id set cd.amount = \'4\'
Even cleaner, since update accepts a third "where" array parameter:
$invoiceId = 13; $amount = 4; $data = array('cd.amount'=>$amount, 'cd.amount_verified'=>'1'); $this->db->update('Customer_donations cd join Invoices i on i.cd_id = cd.cd_id', $data, array('i.invoice_id' => $invoiceId));