通过值增加Cakephp数据库字段 [英] Incrementing Cakephp database field by a value
本文介绍了通过值增加Cakephp数据库字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个字段的值我必须增加字段值一个特定的值。
我使用这个
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';
这不适用于我的数量是一个整数coloumn这里。
which doesnt works for me quantity is a integer coloumn here. Also will it work when nothing is in database?.
尊敬的
Himanshu Sharma
Regards Himanshu Sharma
推荐答案
您可以对此
一个小小的googling显示这个很快:
http:// nut-and-bolts-of-cakephp。 com / 2008/05/22 / incrementing-a-field-in-cakephp /
a little googling reveals this pretty quick: http://nuts-and-bolts-of-cakephp.com/2008/05/22/incrementing-a-field-in-cakephp/
这篇关于通过值增加Cakephp数据库字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文