The primary key cannot be obtained automatically, and the id must be added manually.
之间
之间 2019-06-27 13:55:05
0
4
1336

$user = new User();
$data = [
'name'=>'Lu Bu',
'password'=>'888'
];
//Execute the add operation
$result = $user->save($data);

Field 'id' doesn't have a default value


之间
之间

reply all(2)
!

This is the way to add it

  • reply yes
    之间 author 2020-05-27 17:22:38
  • reply This was 300 days ago, when I just learned TP, haha
    之间 author 2020-05-27 17:23:13
殘留の回憶

Don’t you have to write a where condition to update the data? It definitely won’t work like this

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template