Tp5 插入 500

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_25354709/article/details/88398719

一、插入的时候报500

比如:

$formData = [
	"acc" => "account2",
	"name" => "王二",
	"phone" => "18798701234",
	"email" => "[email protected]",
	"scope" => "2",
	"idcard" => "360428199812123318",		
	"pwd" => "000000"
];
$id = Db::table('daichao_report_user')->insertGetId($formData);
return $id;

按道理,没有任何问题,但是前端一直报500的错误。
原因:

数据库中的表的主键,没有设置为自动递增。

猜你喜欢

转载自blog.csdn.net/qq_25354709/article/details/88398719
tp5
今日推荐