cakephp增删改查

$this->create();
$ret = $this->save($data);

$ret = $this->deleteAll(array('user_id'=>$user_id,'stock_code'=>$code));

改其实和增加没有太大区别,只要save的时候带上id就好了,如:
$data = array('id'=>1,'name'=>'huahua');
$this->save($data);

$list = $this->find('all', array('conditions'=>array('user_id'=>$user_id)));

 

posted on 2018-04-30 12:58  薇薇123456  阅读(181)  评论(0编辑  收藏  举报

导航