Reputation: 134
I am trying to update a field in my table with values from array key
, below is statement but I cannot get to work when using array key. I am new and likely not creating the statement correctly. Any help is appreciated.
$this->db->set('product_qoh', 'product_qoh - $item['sold']' ,FALSE);
Upvotes: 1
Views: 46
Reputation: 134
Below worked for me, the above was replacing the cell value with the negate of $item['sold'].
$this->db->set('product_qoh', 'product_qoh - ' .$item['sold'] ,FALSE);
Upvotes: 2