已经引入Db类和requert类,但还是报错
public function save(Request $request){
$data=input('post.');
dump($data);
$code=Db::execute("insert into user value(null,:username,:password)",$data);
if($code){
$this->success('添加成功','tp5/public/user');
}else{
$this->error('添加失败');
}
}
public function save(Request $request){
$data=input('post.');
dump($data);
$code=Db::execute("insert into user value(null,:username,:password)",$data);
if($code){
$this->success('添加成功','tp5/public/user');
}else{
$this->error('添加失败');
}
}
'username' => 'test',
'password' => '123456'
);
'username' => 'test',
'password' => '123456'
);
对了对了,感谢大佬