public function admin_add()
{
//dump(input('post.'));
if(request()->isPost()){
$data = [
'username'=>input('username'),
'password'=>md5(input('password')),
'logintime'=>time(),
];
if(db('user')->insert($data)){
}
}else{
echo 'n';
} 总是出现
Driver Error Message Duplicata du champ '4294967295' pour la clef 'PRIMARY'
Database Status
Error Code 10501
Error Message SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicata du champ '4294967295' pour la clef 'PRIMARY'
Error SQL INSERT INTO `hd_user` (`username` , `password` , `logintime`) VALUES ('admin' , '698d51a19d8a121ce581499d7b701668' , 1504709461)之前上面这sql在数据裤也不能正常写入的报同样的错,然后修改了表,数据裤能正常写入了,可tp还是一样问题提示
[10501] PDOException in Connection.php line 451
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicata du champ '4294967295' pour la clef 'PRIMARY'
// 调试结束
$this->debug(false);
$this->numRows = $this->PDOStatement->rowCount();
return $this->numRows;
} catch (\PDOException $e) {
if ($this->isBreak($e)) {
return $this->close()->execute($sql, $bind);
}
throw new PDOException($e, $this->config, $this->getLastsql());
} catch (\Exception $e) {
if ($this->isBreak($e)) {
return $this->close()->execute($sql, $bind);
}
throw $e;
}
} /**sql是这样的
CREATE TABLE IF NOT EXISTS `hd_user` (
`id` tinyint(4) NOT NULL auto_increment,
`username` varchar(100) NOT NULL,
`password` varchar(40) NOT NULL,
`logintime` int(10) unsigned NOT NULL DEFAULT '0',
`loginip` char(20) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;大神求助 最佳答案