Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
729 views
in Technique[技术] by (71.8m points)

mysql - New version of PHPMyAdmin has stopped me being able to edit data

PHPMyAdmin has just been upgraded by my server admin to v4.0.4.2.

Now I am unable to edit rows in the following table:

CREATE TABLE IF NOT EXISTS `product_options` (
  `product_id` int(10) NOT NULL,
  `option_id` int(10) NOT NULL,
  KEY `product_id` (`product_id`,`option_id`)
)

PHPMyAdmin just returns this error message when I browse data in the table:

This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

I don't want a unique column in this table, so how can I edit data? Is there a setting I can change?

Many thanks

MySQL v5.1.70

EDIT/SOLUTION

I realised that it wasn't necessarily a new unique column PHPMyAdmin was wanting me to create, but instead a unique index. This means that the structure of my tables didn't have to change - I just had to add a unique index, which I should have been doing anyway.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Without unique key, there is no way to differentiate between two same records which can exists. Therefore phpMyAdmin can not safely edit the table - you have no clue which of these would end up edited. Do you really want to have duplicate records in this table?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...