我已经创建了一个表,现在我发现,当我尝试删除一行或更改一个字段时,我会得到以下消息:
收到意外更新计数(实际: 0,预期: 1)。所有更改都将回滚。
我看到了另一个问题,它说要创建一个独特的字段,然后再试一次。我删除了这个表,用一个唯一的字段重新创建了它,并且仍然得到相同的错误。
创建表的代码是:
create table 'transcribercertifications' (
id int(11) not null unique auto_increment,
tid int(11) not null,
certId varchar(32) not null,
regNum int(11) not null,
expiration date
);
我一直在PhpStorm中删除和更新“手工”。如果能帮你解决这个问题,我将不胜感激。
发布于 2019-09-08 06:35:03
您需要将id
列作为主键。试试这个:
create table 'transcribercertifications' (
id int(11) not null primary key auto_increment,
tid int(11) not null,
certId varchar(32) not null,
regNum int(11) not null,
expiration date
);
https://stackoverflow.com/questions/57839680
复制相似问题