Incrementing Cakephp database field by a value
问题 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'; which doesnt works for me quantity is a integer coloumn here. Also will it work when nothing is in database?. Regards Himanshu Sharma 回答1: 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 回答2: I used updateAll in my code to increment views in an