laravel中的CRUD操作中,通过对代表数据表中row的model对象操作,来更新数据库表。

对于创建新的row的操作,有两种功能上相同的方法:

1.create;

$user = User::create(array('email => 'xx@yy.zz','password'=>'mypassword'));

2.new and save

$user = new User;
$user->email = 'xx@yy.zz';
$user->password = 'mypassword';
$user->save();

 

相关文章:

  • 2022-02-03
  • 2021-11-22
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-16
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-09-29
相关资源
相似解决方案