laravel使用模型進行添加時,使用對象直接指向字段添加php
/* author:咔咔 address:陝西西安 wechat:fangkangfk */ $user = new user(); $user-> user_name = 'haha'; $user-> email = '139739364@qq3com'; $user-> password = 'fangkang'; $data = $user->save();
tp5使用數組型就能夠laravel
$user = new user(); $data['user_name'] = 'fangkang'; $data['email'] = '1397393964@qq.com'; $data['password'] = 'fang1996l'; $data = $user->save($data);