tp5.1的模型操作

/*
author:咔咔
wechat:fangkangfk
*/

        $role = new Role();
        $data = [
            'role_name'=>'kaka',
            'mark'=>'this is kaka name'
        ];
        $role->save($data);

        $role = new Role();
        $data = [
            'role_name'=>'niuniu'
        ];
        $role->where([
            'role_name'=>'kaka'
        ])->update($data);

        $role = new Role();
        $data = $role->select();

 

你可能感兴趣的:(thinkPHP)