2016
01-27
01-27
Yii2.0单个与批量删除数据 推荐
直接model删除$model=User::find($id);$model->delete();带有条件的删除$connection->createCommand()->delete('tbl_user','status=0')->execute();使用Query查询删除$connection->createCommand('DELETEFROMtbl_userWHEREuserid=:userid')->execute();使用预处理语句删除方法一$model=$connection->createCommand('DELETEFROMtbl_userWHEREuserid=:userid');...
继续阅读 >