laravel增删改查(查询构建器)

1.增

$data = [
'username' => 'xiaohong',
'nickname' => '小红红',
'email' => '12356788@qq.com',
'phone' => '',
'password' => md5(''),
'login_status'=> ,
];
$res=DB::table('admins')->insertGetId($data);

2.删

$res=DB::table('admins')->whereIn('id',[,])->delete();

3.改

$data = [
'nickname'=> '超级管理员',
'email' => 'itheima@qq.com',
];
$res = DB::table('admins')->where('username','=','root')->update($data);

4.查

$where=[
['id','>',],
['id','<',],
];
$res=DB::table('admins')->where('nickname');
上一篇:C#将集合快速排序


下一篇:codeforces #260 DIV 2 C题Boredom(DP)