Nikita Ag
Nikita Ag

Reputation: 2426

Not able to edit table in phpmyadmin

Not able to edit existing table in phpmyadmin. I tried setting id as primary key and also auto increment but it throws error in both cases even though there is no other column which is being set as primary key or auto increment.

Upvotes: 0

Views: 68

Answers (1)

Stian Skjelstad
Stian Skjelstad

Reputation: 2335

You have to first edit the entries in the table, so that there are no duplicate rows with the same id. The error message you receive says what the problem is: "duplicate entry '33' for key primary". So there is atleast two entries with the same id number, 33. After you have fixed those problems, then you should be allowed to set the property primary key on id.

Primary key implies that all columns that builds up the primary key are unique when combined, and if only one column, then all those entries in that columnd needs to be unique.

Upvotes: 1

Related Questions