Incrementing Cakephp database field by a value

后端 未结 4 779
挽巷
挽巷 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条回答
  •  难免孤独
    2020-12-06 06:48

    You can try this code also. Works fine for simple ++/-- operations without the need of additional querying.

    https://gist.github.com/denchev/8209318

提交回复
热议问题