Issue with updateBatch method |
10-30-2023, 05:23 AM
(This post was last modified: 10-30-2023, 11:38 AM by ozornick. Edit Reason: Reformat code )
Hi,
I have a DB table named 'products'. It has the following columns: id, stock_shipped, stock_on_hand I am facing some issues in using the updateBatch method. When an order is placed, the stock should update properly for all the items/products in the order. So I need to increase/decrease the existing value in DB table columns: stock_shipped and stock_on_hand Code: PHP Code: $data[0]['id'] = 100; Can you please suggest a way to use the same method: updateBatch correctly?
Can you carefully read here please https://codeigniter.com/user_guide/datab...pdatebatch
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
I read the documentation. Nothing was mentioned about the existing value.
How can I add/subtract from, the current value of a database column when I use the data array? (10-31-2023, 12:41 AM)ashlythomas Wrote: How can I add/subtract from, the current value of a database column when I use the data array? I'm not sure it works, but try to use RawSql. See https://codeigniter.com/user_guide/datab...der-insert |
Welcome Guest, Not a member yet? Register Sign In |