Yii 中 AR 删除数据的方法

来源:互联网 发布:水音铃 淘宝 编辑:程序博客网 时间:2024/06/15 09:43
$post=Post::model()->findByPk(10); // assuming there is a post whose ID is 10$post->delete(); // delete the row from the database table


// delete the rows matching the specified conditionPost::model()->deleteAll($condition,$params);// delete the rows matching the specified condition and primary key(s)Post::model()->deleteByPk($pk,$condition,$params);


0 0
原创粉丝点击