Код: Выделить всё
UPDATE `Customer_donations` cd
JOIN Invoices i ON i.cd_id = cd.cd_id
SET cd.amount = '4', cd.amount_verified = '1'
WHERE i.invoice_id = '13';
Код: Выделить всё
$data = array('cd.amount' => $amount, 'cd.amount_verified' => '1');
$this->db->join('Invoices i', 'i.cd_id = cd.cd_id')
->where('i.invoice_id', $invoiceId);
// update the table with the new data
if ($this->db->update('Customer_donations cd', $data)) {
return true;
}
Код: Выделить всё
UPDATE `Customer_donations` cd
SET `cd`.`amount` = '1', `cd`.`amount_verified` = '1'
WHERE `i`.`invoice_id` = '13'
Подробнее здесь: https://stackoverflow.com/questions/957 ... -with-a-jo
Мобильная версия