慕课网:4-2—— 使用DB facade实现CURD (09:11)

    public function test1()
    {
        //新增数据:
        /*        $bool=DB::insert('insert into student(name,age) VALUES (?,?)',
                    ['imooc',18]
                );
                var_dump($bool);*/

        //更新数据:
        /*        $bool=DB::update('update student set age=? where name=?',
                    [20, 'sean']);
                var_dump($bool);*/

        //查询数据表中的数据:
        /*       $students=DB::select('select * from student where id> ?',[1001]);
                dd($students);*/

        //删除数据:
//        $num=DB::delete('delete from student where id>?',[1001]);
//        var_dump($num);
    }

  

原文地址:https://www.cnblogs.com/yiweiyihang/p/7998113.html