Incrementing Cakephp database field by a value

后端 未结 4 746
挽巷
挽巷 2020-12-06 06:04

I have this field whose value i have to increment the field value by a specific value. I am using this

$data[\'quantity\']     = \'Order.quantity+1\';
         


        
4条回答
  •  萌比男神i
    2020-12-06 06:52

    you can use updateAll() for this

    a little googling reveals this pretty quick: http://cakephp.1045679.n5.nabble.com/Auto-Increment-A-Field-td3491697.html

提交回复
热议问题