出现诡异的问题

浏览:2159 发布日期:2017/09/07 分类:求助交流 关键字: 写入 失败
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 ;
大神求助
最佳答案
评论( 相关
后面还有条评论,点击查看>>